Package org.msgpack.value
Interface NumberValue
-
- All Superinterfaces:
Value
- All Known Subinterfaces:
FloatValue,ImmutableFloatValue,ImmutableIntegerValue,ImmutableNumberValue,IntegerValue
- All Known Implementing Classes:
ImmutableBigIntegerValueImpl,ImmutableDoubleValueImpl,ImmutableLongValueImpl
public interface NumberValue extends Value
Base interface ofIntegerValueandFloatValueinterfaces. To extract primitive type values, call toXXX methods, which may lose some information by rounding or truncation.- See Also:
IntegerValue,FloatValue
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description java.math.BigIntegertoBigInteger()Represent this value as a BigInteger, which may involve rounding or truncation of the original value.bytetoByte()Represent this value as a byte value, which may involve rounding or truncation of the original value.doubletoDouble()Represent this value as a 64-bit double value, which may involve rounding or truncation of the original value.floattoFloat()Represent this value as a 32-bit float value, which may involve rounding or truncation of the original value.inttoInt()Represent this value as an int value, which may involve rounding or truncation of the original value.longtoLong()Represent this value as a long value, which may involve rounding or truncation of the original value.shorttoShort()Represent this value as a short value, which may involve rounding or truncation of the original value.-
Methods inherited from interface org.msgpack.value.Value
asArrayValue, asBinaryValue, asBooleanValue, asExtensionValue, asFloatValue, asIntegerValue, asMapValue, asNilValue, asNumberValue, asRawValue, asStringValue, equals, getValueType, immutableValue, isArrayValue, isBinaryValue, isBooleanValue, isExtensionValue, isFloatValue, isIntegerValue, isMapValue, isNilValue, isNumberValue, isRawValue, isStringValue, toJson, writeTo
-
-
-
-
Method Detail
-
toByte
byte toByte()
Represent this value as a byte value, which may involve rounding or truncation of the original value. the value.
-
toShort
short toShort()
Represent this value as a short value, which may involve rounding or truncation of the original value.
-
toInt
int toInt()
Represent this value as an int value, which may involve rounding or truncation of the original value. value.
-
toLong
long toLong()
Represent this value as a long value, which may involve rounding or truncation of the original value.
-
toBigInteger
java.math.BigInteger toBigInteger()
Represent this value as a BigInteger, which may involve rounding or truncation of the original value.
-
toFloat
float toFloat()
Represent this value as a 32-bit float value, which may involve rounding or truncation of the original value.
-
toDouble
double toDouble()
Represent this value as a 64-bit double value, which may involve rounding or truncation of the original value.
-
-