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 ofJsonValue
for simpleJsonValue.ValueType
s 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.ValueType
valueType
-
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 boolean
equals(java.lang.Object obj)
Compares the specified object with thisJsonValue
object for equality.JsonValue.ValueType
getValueType()
Returns the value type of this JSON value.int
hashCode()
Returns the hash code value for thisJsonValue
object.java.lang.String
toString()
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:
getValueType
in interfaceJsonValue
- Returns:
- JSON value type
-
equals
public boolean equals(java.lang.Object obj)
Compares the specified object with thisJsonValue
object for equality. Returnstrue
if and only if the specified object is also a JsonValue, and theirgetValueType()
objects are equal.- Overrides:
equals
in classjava.lang.Object
- Parameters:
obj
- the object to be compared for equality with this JsonValue- Returns:
true
if the specified object is equal to this JsonValue
-
hashCode
public int hashCode()
Returns the hash code value for thisJsonValue
object. The hash code of theJsonValue
object is defined to be itsgetValueType()
object's hash code.- Overrides:
hashCode
in classjava.lang.Object
- Returns:
- the hash code value for this
JsonValue
object
-
-