public class ImmutableBooleanValueImpl extends AbstractImmutableValue implements ImmutableBooleanValue
ImmutableBooleanValueImpl Implements ImmutableBooleanValue using a boolean field.
This class is a singleton. ImmutableBooleanValueImpl.trueInstance() and ImmutableBooleanValueImpl.falseInstance() are the only instances of this class.BooleanValue| Modifier and Type | Field and Description |
|---|---|
static ImmutableBooleanValue |
FALSE |
static ImmutableBooleanValue |
TRUE |
private boolean |
value |
| Modifier | Constructor and Description |
|---|---|
private |
ImmutableBooleanValueImpl(boolean value) |
| Modifier and Type | Method and Description |
|---|---|
ImmutableBooleanValue |
asBooleanValue()
Returns the value as
BooleanValue. |
boolean |
equals(java.lang.Object o)
Compares this value to the specified object.
|
boolean |
getBoolean()
Returns the value as a
boolean. |
ValueType |
getValueType()
Returns type of this value.
|
int |
hashCode() |
ImmutableBooleanValue |
immutableValue()
Returns immutable copy of this value.
|
java.lang.String |
toJson()
Returns json representation of this Value.
|
java.lang.String |
toString() |
void |
writeTo(MessagePacker packer)
Serializes the value using the specified
MessagePacker |
asArrayValue, asBinaryValue, asExtensionValue, asFloatValue, asIntegerValue, asMapValue, asNilValue, asNumberValue, asRawValue, asStringValue, asTimestampValue, isArrayValue, isBinaryValue, isBooleanValue, isExtensionValue, isFloatValue, isIntegerValue, isMapValue, isNilValue, isNumberValue, isRawValue, isStringValue, isTimestampValueclone, finalize, getClass, notify, notifyAll, wait, wait, waitasArrayValue, asBinaryValue, asFloatValue, asIntegerValue, asMapValue, asNilValue, asRawValue, asStringValue, asTimestampValueasExtensionValue, asNumberValue, isArrayValue, isBinaryValue, isBooleanValue, isExtensionValue, isFloatValue, isIntegerValue, isMapValue, isNilValue, isNumberValue, isRawValue, isStringValue, isTimestampValuepublic static final ImmutableBooleanValue TRUE
public static final ImmutableBooleanValue FALSE
private final boolean value
public ValueType getValueType()
Valueinstanceof to check type of a value because type of a mutable value is variable.getValueType 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 ValueasBooleanValue in class AbstractImmutableValuepublic ImmutableBooleanValue immutableValue()
Valuethis without copying the value if this value is already immutable.immutableValue in interface Valuepublic boolean getBoolean()
BooleanValueboolean.getBoolean in interface BooleanValuepublic void writeTo(MessagePacker packer) 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.Object