Package javax.json
Class JsonValueImpl
- java.lang.Object
-
- javax.json.JsonValueImpl
-
- All Implemented Interfaces:
java.io.Serializable,JsonValue
final class JsonValueImpl extends java.lang.Object implements JsonValue, java.io.Serializable
Private implementation ofJsonValuefor simpleJsonValue.ValueTypes allowing their usage in constants which are better to implementSerializable.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface javax.json.JsonValue
JsonValue.ValueType
-
-
Field Summary
Fields Modifier and Type Field Description private JsonValue.ValueTypevalueType-
Fields inherited from interface javax.json.JsonValue
EMPTY_JSON_ARRAY, EMPTY_JSON_OBJECT, FALSE, NULL, TRUE
-
-
Constructor Summary
Constructors Constructor Description JsonValueImpl(JsonValue.ValueType valueType)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanequals(java.lang.Object obj)Compares the specified object with thisJsonValueobject for equality.JsonValue.ValueTypegetValueType()Returns the value type of this JSON value.inthashCode()Returns the hash code value for thisJsonValueobject.java.lang.StringtoString()Returns JSON text for this JSON value.-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface javax.json.JsonValue
asJsonArray, asJsonObject
-
-
-
-
Field Detail
-
valueType
private final JsonValue.ValueType valueType
-
-
Constructor Detail
-
JsonValueImpl
JsonValueImpl(JsonValue.ValueType valueType)
-
-
Method Detail
-
getValueType
public JsonValue.ValueType getValueType()
Returns the value type of this JSON value.- Specified by:
getValueTypein interfaceJsonValue- Returns:
- JSON value type
-
equals
public boolean equals(java.lang.Object obj)
Compares the specified object with thisJsonValueobject for equality. Returnstrueif and only if the specified object is also a JsonValue, and theirgetValueType()objects are equal.- Overrides:
equalsin classjava.lang.Object- Parameters:
obj- the object to be compared for equality with this JsonValue- Returns:
trueif the specified object is equal to this JsonValue
-
hashCode
public int hashCode()
Returns the hash code value for thisJsonValueobject. The hash code of theJsonValueobject is defined to be itsgetValueType()object's hash code.- Overrides:
hashCodein classjava.lang.Object- Returns:
- the hash code value for this
JsonValueobject
-
-