Class JsonStringImpl

java.lang.Object
org.glassfish.json.JsonStringImpl
All Implemented Interfaces:
JsonString, JsonValue

final class JsonStringImpl extends Object implements JsonString
JsonString impl
  • Field Details

    • value

      private final String value
  • Constructor Details

    • JsonStringImpl

      JsonStringImpl(String value)
  • Method Details

    • getString

      public String getString()
      Description copied from interface: JsonString
      Returns the JSON string value.
      Specified by:
      getString in interface JsonString
      Returns:
      a JSON string value
    • getChars

      public CharSequence getChars()
      Description copied from interface: JsonString
      Returns the char sequence for the JSON String value
      Specified by:
      getChars in interface JsonString
      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 interface JsonValue
      Returns:
      JSON value type
    • hashCode

      public int hashCode()
      Description copied from interface: JsonString
      Returns the hash code value for this JsonString object. The hash code of a JsonString object is defined to be its JsonString.getString() object's hash code.
      Specified by:
      hashCode in interface JsonString
      Overrides:
      hashCode in class Object
      Returns:
      the hash code value for this JsonString object
    • equals

      public boolean equals(Object obj)
      Description copied from interface: JsonString
      Compares the specified object with this JsonString for equality. Returns true if and only if the specified object is also a JsonString, and their JsonString.getString() objects are equal.
      Specified by:
      equals in interface JsonString
      Overrides:
      equals in class Object
      Parameters:
      obj - the object to be compared for equality with this JsonString
      Returns:
      true if the specified object is equal to this JsonString
    • toString

      public String toString()
      Description copied from interface: JsonValue
      Returns JSON text for this JSON value.
      Specified by:
      toString in interface JsonValue
      Overrides:
      toString in class Object
      Returns:
      JSON text