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 ofIntegerValue
andFloatValue
interfaces. 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.BigInteger
toBigInteger()
Represent this value as a BigInteger, which may involve rounding or truncation of the original value.byte
toByte()
Represent this value as a byte value, which may involve rounding or truncation of the original value.double
toDouble()
Represent this value as a 64-bit double value, which may involve rounding or truncation of the original value.float
toFloat()
Represent this value as a 32-bit float value, which may involve rounding or truncation of the original value.int
toInt()
Represent this value as an int value, which may involve rounding or truncation of the original value.long
toLong()
Represent this value as a long value, which may involve rounding or truncation of the original value.short
toShort()
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.
-
-