Package org.glassfish.json
Class JsonStringImpl
- java.lang.Object
-
- org.glassfish.json.JsonStringImpl
-
- All Implemented Interfaces:
JsonString
,JsonValue
final class JsonStringImpl extends java.lang.Object implements JsonString
JsonString impl
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface javax.json.JsonValue
JsonValue.ValueType
-
-
Constructor Summary
Constructors Constructor Description JsonStringImpl(java.lang.String value)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
equals(java.lang.Object obj)
Compares the specified object with thisJsonString
for equality.java.lang.CharSequence
getChars()
Returns the char sequence for the JSON String valuejava.lang.String
getString()
Returns the JSON string value.JsonValue.ValueType
getValueType()
Returns the value type of this JSON value.int
hashCode()
Returns the hash code value for thisJsonString
object.java.lang.String
toString()
Returns JSON text for this JSON value.
-
-
-
Method Detail
-
getString
public java.lang.String getString()
Description copied from interface:JsonString
Returns the JSON string value.- Specified by:
getString
in interfaceJsonString
- Returns:
- a JSON string value
-
getChars
public java.lang.CharSequence getChars()
Description copied from interface:JsonString
Returns the char sequence for the JSON String value- Specified by:
getChars
in interfaceJsonString
- Returns:
- a char sequence for the JSON String value
-
getValueType
public JsonValue.ValueType getValueType()
Description copied from interface:JsonValue
Returns the value type of this JSON value.- Specified by:
getValueType
in interfaceJsonValue
- Returns:
- JSON value type
-
hashCode
public int hashCode()
Description copied from interface:JsonString
Returns the hash code value for thisJsonString
object. The hash code of aJsonString
object is defined to be itsJsonString.getString()
object's hash code.- Specified by:
hashCode
in interfaceJsonString
- Overrides:
hashCode
in classjava.lang.Object
- Returns:
- the hash code value for this
JsonString
object
-
equals
public boolean equals(java.lang.Object obj)
Description copied from interface:JsonString
Compares the specified object with thisJsonString
for equality. Returnstrue
if and only if the specified object is also aJsonString
, and theirJsonString.getString()
objects are equal.- Specified by:
equals
in interfaceJsonString
- Overrides:
equals
in classjava.lang.Object
- Parameters:
obj
- the object to be compared for equality with thisJsonString
- Returns:
true
if the specified object is equal to thisJsonString
-
-