public interface IntegerValue extends NumberValue
Modifier and Type | Method and Description |
---|---|
java.math.BigInteger |
asBigInteger()
Returns the value as a
BigInteger . |
byte |
asByte()
Returns the value as a
byte , otherwise throws an exception. |
int |
asInt()
Returns the value as an
int , otherwise throws an exception. |
long |
asLong()
Returns the value as a
long , otherwise throws an exception. |
short |
asShort()
Returns the value as a
short , otherwise throws an exception. |
boolean |
isInByteRange()
Returns true if the value is in the range of [-27 to 27-1].
|
boolean |
isInIntRange()
Returns true if the value is in the range of [-231 to 231-1]
|
boolean |
isInLongRange()
Returns true if the value is in the range of [-263 to 263-1]
|
boolean |
isInShortRange()
Returns true if the value is in the range of [-215 to 215-1]
|
MessageFormat |
mostSuccinctMessageFormat()
Returns the most succinct MessageFormat type to represent this integer value.
|
toBigInteger, toByte, toDouble, toFloat, toInt, toLong, toShort
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
boolean isInByteRange()
boolean isInShortRange()
boolean isInIntRange()
boolean isInLongRange()
MessageFormat mostSuccinctMessageFormat()
byte asByte()
byte
, otherwise throws an exception.MessageIntegerOverflowException
- If the value does not fit in the range of byte
type.short asShort()
short
, otherwise throws an exception.MessageIntegerOverflowException
- If the value does not fit in the range of short
type.int asInt()
int
, otherwise throws an exception.MessageIntegerOverflowException
- If the value does not fit in the range of int
type.long asLong()
long
, otherwise throws an exception.MessageIntegerOverflowException
- If the value does not fit in the range of long
type.java.math.BigInteger asBigInteger()
BigInteger
.