public final class LongMismatch
extends java.lang.Object
long
values in ValueMismatch
es.Modifier and Type | Method and Description |
---|---|
static io.spine.change.ValueMismatch |
expectedNonZero(long expected,
long newValue,
int version)
Creates
ValueMismatch for the case of discovering zero value,
when a non zero amount was expected by a command. |
static io.spine.change.ValueMismatch |
expectedZero(long actual,
long newValue,
int version)
Creates
ValueMismatch for the case of discovering not zero value,
when a zero amount was expected by a command. |
static io.spine.change.ValueMismatch |
of(long expected,
long actual,
long newValue,
int version)
Creates a new instance of
ValueMismatch with the passed values for a long attribute. |
static io.spine.change.ValueMismatch |
unexpectedValue(long expected,
long actual,
long newValue,
int version)
Creates
ValueMismatch for the case of discovering a value
different than by a command. |
static long |
unpackActual(io.spine.change.ValueMismatch mismatch)
Obtains actual long value from the passed mismatch.
|
static long |
unpackExpected(io.spine.change.ValueMismatch mismatch)
Obtains expected long value from the passed mismatch.
|
static long |
unpackNewValue(io.spine.change.ValueMismatch mismatch)
Obtains new long value from the passed mismatch.
|
public static io.spine.change.ValueMismatch expectedZero(long actual, long newValue, int version)
ValueMismatch
for the case of discovering not zero value,
when a zero amount was expected by a command.actual
- the value discovered instead of zeronewValue
- the new value requested in the commandversion
- the version of the entity in which the mismatch is discoveredValueMismatch
instancepublic static io.spine.change.ValueMismatch expectedNonZero(long expected, long newValue, int version)
ValueMismatch
for the case of discovering zero value,
when a non zero amount was expected by a command.expected
- the value of the field that the command wanted to clearnewValue
- the new value requested in the commandversion
- the version of the entity in which the mismatch is discoveredValueMismatch
instancepublic static io.spine.change.ValueMismatch unexpectedValue(long expected, long actual, long newValue, int version)
ValueMismatch
for the case of discovering a value
different than by a command.expected
- the value expected by the commandactual
- the value discovered instead of the expected stringnewValue
- the new value requested in the commandversion
- the version of the entity in which the mismatch is discoveredValueMismatch
instancepublic static io.spine.change.ValueMismatch of(long expected, long actual, long newValue, int version)
ValueMismatch
with the passed values for a long attribute.public static long unpackExpected(io.spine.change.ValueMismatch mismatch)
java.lang.RuntimeException
- if the passed instance represent a mismatch of non-long valuespublic static long unpackActual(io.spine.change.ValueMismatch mismatch)
java.lang.RuntimeException
- if the passed instance represent a mismatch of non-long valuespublic static long unpackNewValue(io.spine.change.ValueMismatch mismatch)
java.lang.RuntimeException
- if the passed instance represent a mismatch of non-long values