public final class FloatMismatch
extends java.lang.Object
float
values in ValueMismatch
es.Modifier and Type | Method and Description |
---|---|
static io.spine.change.ValueMismatch |
expectedNonZero(float expected,
float 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(float actual,
float 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(float expected,
float actual,
float newValue,
int version)
Creates a new instance of
ValueMismatch with the passed values for a float attribute. |
static io.spine.change.ValueMismatch |
unexpectedValue(float expected,
float actual,
float newValue,
int version)
Creates
ValueMismatch for the case of discovering a value
different than by a command. |
static float |
unpackActual(io.spine.change.ValueMismatch mismatch)
Obtains actual float value from the passed mismatch.
|
static float |
unpackExpected(io.spine.change.ValueMismatch mismatch)
Obtains expected float value from the passed mismatch.
|
static float |
unpackNewValue(io.spine.change.ValueMismatch mismatch)
Obtains new float value from the passed mismatch.
|
public static io.spine.change.ValueMismatch expectedZero(float actual, float 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(float expected, float 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(float expected, float actual, float 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(float expected, float actual, float newValue, int version)
ValueMismatch
with the passed values for a float attribute.public static float unpackExpected(io.spine.change.ValueMismatch mismatch)
java.lang.RuntimeException
- if the passed instance represent a mismatch of non-float valuespublic static float unpackActual(io.spine.change.ValueMismatch mismatch)
java.lang.RuntimeException
- if the passed instance represent a mismatch of non-float valuespublic static float unpackNewValue(io.spine.change.ValueMismatch mismatch)
java.lang.RuntimeException
- if the passed instance represent a mismatch of non-float values