public class ImmutableLongValueImpl extends java.lang.Object implements ImmutableIntegerValue
ImmutableLongValueImpl Implements ImmutableIntegerValue using a long field.IntegerValue| Constructor and Description |
|---|
ImmutableLongValueImpl(long value) |
| Modifier and Type | Method and Description |
|---|---|
ImmutableArrayValue |
asArrayValue()
Returns the value as
ArrayValue. |
java.math.BigInteger |
asBigInteger()
Returns the value as a
BigInteger. |
ImmutableBinaryValue |
asBinaryValue()
Returns the value as
BinaryValue. |
ImmutableBooleanValue |
asBooleanValue()
Returns the value as
BooleanValue. |
byte |
asByte()
Returns the value as a
byte, otherwise throws an exception. |
ImmutableExtensionValue |
asExtensionValue()
Returns the value as
ExtensionValue. |
ImmutableFloatValue |
asFloatValue()
Returns the value as
FloatValue. |
int |
asInt()
Returns the value as an
int, otherwise throws an exception. |
ImmutableIntegerValue |
asIntegerValue()
Returns the value as
IntegerValue. |
long |
asLong()
Returns the value as a
long, otherwise throws an exception. |
ImmutableMapValue |
asMapValue()
Returns the value as
MapValue. |
ImmutableNilValue |
asNilValue()
Returns the value as
NilValue. |
ImmutableNumberValue |
asNumberValue()
Returns the value as
NumberValue. |
ImmutableRawValue |
asRawValue()
Returns the value as
RawValue. |
short |
asShort()
Returns the value as a
short, otherwise throws an exception. |
ImmutableStringValue |
asStringValue()
Returns the value as
StringValue. |
boolean |
equals(java.lang.Object o)
Compares this value to the specified object.
|
ValueType |
getValueType()
Returns type of this value.
|
int |
hashCode() |
ImmutableIntegerValue |
immutableValue()
Returns immutable copy of this value.
|
boolean |
isArrayValue()
Returns true if type of this value is Array.
|
boolean |
isBinaryValue()
Returns true if type of this value is Binary.
|
boolean |
isBooleanValue()
Returns true if type of this value is Boolean.
|
boolean |
isExtensionValue()
Returns true if type of this an Extension.
|
boolean |
isFloatValue()
Returns true if type of this value is Float.
|
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]
|
boolean |
isIntegerValue()
Returns true if type of this value is Integer.
|
boolean |
isMapValue()
Returns true if type of this value is Map.
|
boolean |
isNilValue()
Returns true if type of this value is Nil.
|
boolean |
isNumberValue()
Returns true if type of this value is Integer or Float.
|
boolean |
isRawValue()
Returns true if type of this value is String or Binary.
|
boolean |
isStringValue()
Returns true if type of this value is String.
|
MessageFormat |
mostSuccinctMessageFormat()
Returns the most succinct MessageFormat type to represent this integer value.
|
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.
|
java.lang.String |
toJson()
Returns json representation of this 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.
|
java.lang.String |
toString() |
void |
writeTo(MessagePacker pk)
Serializes the value using the specified
MessagePacker |
clone, finalize, getClass, notify, notifyAll, wait, wait, waitasArrayValue, asBinaryValue, asBooleanValue, asFloatValue, asMapValue, asNilValue, asRawValue, asStringValueasExtensionValue, isArrayValue, isBinaryValue, isBooleanValue, isExtensionValue, isFloatValue, isIntegerValue, isMapValue, isNilValue, isNumberValue, isRawValue, isStringValuepublic ValueType getValueType()
Valueinstanceof to check type of a value because type of a mutable value is variable.getValueType in interface Valuepublic ImmutableIntegerValue immutableValue()
Valuethis without copying the value if this value is already immutable.immutableValue in interface Valuepublic ImmutableNumberValue asNumberValue()
ValueNumberValue. Otherwise throws MessageTypeCastException.
Note that you can't use instanceof or cast ((NumberValue) thisValue) to check type of a value because type of a mutable value is variable.asNumberValue in interface Valuepublic ImmutableIntegerValue asIntegerValue()
ValueIntegerValue. Otherwise throws MessageTypeCastException.
Note that you can't use instanceof or cast ((IntegerValue) thisValue) to check type of a value because type of a mutable value is variable.asIntegerValue in interface ImmutableValueasIntegerValue in interface Valuepublic byte toByte()
NumberValuetoByte in interface NumberValuepublic short toShort()
NumberValuetoShort in interface NumberValuepublic int toInt()
NumberValuetoInt in interface NumberValuepublic long toLong()
NumberValuetoLong in interface NumberValuepublic java.math.BigInteger toBigInteger()
NumberValuetoBigInteger in interface NumberValuepublic float toFloat()
NumberValuetoFloat in interface NumberValuepublic double toDouble()
NumberValuetoDouble in interface NumberValuepublic boolean isInByteRange()
IntegerValueisInByteRange in interface IntegerValuepublic boolean isInShortRange()
IntegerValueisInShortRange in interface IntegerValuepublic boolean isInIntRange()
IntegerValueisInIntRange in interface IntegerValuepublic boolean isInLongRange()
IntegerValueisInLongRange in interface IntegerValuepublic MessageFormat mostSuccinctMessageFormat()
IntegerValuemostSuccinctMessageFormat in interface IntegerValuepublic byte asByte()
IntegerValuebyte, otherwise throws an exception.asByte in interface IntegerValuepublic short asShort()
IntegerValueshort, otherwise throws an exception.asShort in interface IntegerValuepublic int asInt()
IntegerValueint, otherwise throws an exception.asInt in interface IntegerValuepublic long asLong()
IntegerValuelong, otherwise throws an exception.asLong in interface IntegerValuepublic java.math.BigInteger asBigInteger()
IntegerValueBigInteger.asBigInteger in interface IntegerValuepublic void writeTo(MessagePacker pk) throws java.io.IOException
ValueMessagePackerwriteTo in interface Valuejava.io.IOExceptionMessagePackerpublic boolean equals(java.lang.Object o)
Valuetrue if type and value are equivalent.
If this value is MapValue or ArrayValue, this method check equivalence of elements recursively.public int hashCode()
hashCode in class java.lang.Objectpublic java.lang.String toJson()
ValueFollowing behavior is not configurable at this release and they might be changed at future releases:
U+FFFD replacement character.U+FFFD replacement characterpublic java.lang.String toString()
toString in class java.lang.Objectpublic boolean isNilValue()
ValueasNilValue never throws exceptions.
Note that you can't use instanceof or cast ((NilValue) thisValue) to check type of a value because type of a mutable value is variable.isNilValue in interface Valuepublic boolean isBooleanValue()
ValueasBooleanValue never throws exceptions.
Note that you can't use instanceof or cast ((BooleanValue) thisValue) to check type of a value because type of a mutable value is variable.isBooleanValue in interface Valuepublic boolean isNumberValue()
ValueasNumberValue never throws exceptions.
Note that you can't use instanceof or cast ((NumberValue) thisValue) to check type of a value because type of a mutable value is variable.isNumberValue in interface Valuepublic boolean isIntegerValue()
ValueasIntegerValue never throws exceptions.
Note that you can't use instanceof or cast ((IntegerValue) thisValue) to check type of a value because type of a mutable value is variable.isIntegerValue in interface Valuepublic boolean isFloatValue()
ValueasFloatValue never throws exceptions.
Note that you can't use instanceof or cast ((FloatValue) thisValue) to check type of a value because type of a mutable value is variable.isFloatValue in interface Valuepublic boolean isRawValue()
ValueasRawValue never throws exceptions.
Note that you can't use instanceof or cast ((RawValue) thisValue) to check type of a value because type of a mutable value is variable.isRawValue in interface Valuepublic boolean isBinaryValue()
ValueasBinaryValue never throws exceptions.
Note that you can't use instanceof or cast ((BinaryValue) thisValue) to check type of a value because type of a mutable value is variable.isBinaryValue in interface Valuepublic boolean isStringValue()
ValueasStringValue never throws exceptions.
Note that you can't use instanceof or cast ((StringValue) thisValue) to check type of a value because type of a mutable value is variable.isStringValue in interface Valuepublic boolean isArrayValue()
ValueasArrayValue never throws exceptions.
Note that you can't use instanceof or cast ((ArrayValue) thisValue) to check type of a value because type of a mutable value is variable.isArrayValue in interface Valuepublic boolean isMapValue()
ValueasMapValue never throws exceptions.
Note that you can't use instanceof or cast ((MapValue) thisValue) to check type of a value because type of a mutable value is variable.isMapValue in interface Valuepublic boolean isExtensionValue()
ValueasExtensionValue never throws exceptions.
Note that you can't use instanceof or cast ((ExtensionValue) thisValue) to check type of a value because
type of a mutable value is variable.isExtensionValue in interface Valuepublic ImmutableNilValue asNilValue()
ValueNilValue. Otherwise throws MessageTypeCastException.
Note that you can't use instanceof or cast ((NilValue) thisValue) to check type of a value because type of a mutable value is variable.asNilValue in interface ImmutableValueasNilValue in interface Valuepublic ImmutableBooleanValue asBooleanValue()
ValueBooleanValue. Otherwise throws MessageTypeCastException.
Note that you can't use instanceof or cast ((BooleanValue) thisValue) to check type of a value because type of a mutable value is variable.asBooleanValue in interface ImmutableValueasBooleanValue in interface Valuepublic ImmutableFloatValue asFloatValue()
ValueFloatValue. Otherwise throws MessageTypeCastException.
Note that you can't use instanceof or cast ((FloatValue) thisValue) to check type of a value because type of a mutable value is variable.asFloatValue in interface ImmutableValueasFloatValue in interface Valuepublic ImmutableRawValue asRawValue()
ValueRawValue. Otherwise throws MessageTypeCastException.
Note that you can't use instanceof or cast ((RawValue) thisValue) to check type of a value because type of a mutable value is variable.asRawValue in interface ImmutableValueasRawValue in interface Valuepublic ImmutableBinaryValue asBinaryValue()
ValueBinaryValue. Otherwise throws MessageTypeCastException.
Note that you can't use instanceof or cast ((BinaryValue) thisValue) to check type of a value because type of a mutable value is variable.asBinaryValue in interface ImmutableValueasBinaryValue in interface Valuepublic ImmutableStringValue asStringValue()
ValueStringValue. Otherwise throws MessageTypeCastException.
Note that you can't use instanceof or cast ((StringValue) thisValue) to check type of a value because type of a mutable value is variable.asStringValue in interface ImmutableValueasStringValue in interface Valuepublic ImmutableArrayValue asArrayValue()
ValueArrayValue. Otherwise throws MessageTypeCastException.
Note that you can't use instanceof or cast ((ArrayValue) thisValue) to check type of a value because type of a mutable value is variable.asArrayValue in interface ImmutableValueasArrayValue in interface Valuepublic ImmutableMapValue asMapValue()
ValueMapValue. Otherwise throws MessageTypeCastException.
Note that you can't use instanceof or cast ((MapValue) thisValue) to check type of a value because type of a mutable value is variable.asMapValue in interface ImmutableValueasMapValue in interface Valuepublic ImmutableExtensionValue asExtensionValue()
ValueExtensionValue. Otherwise throws MessageTypeCastException.
Note that you can't use instanceof or cast ((ExtensionValue) thisValue) to check type of a value
because type of a mutable value is variable.asExtensionValue in interface Value