Module jakarta.json
Package jakarta.json

Class JsonValueImpl

  • All Implemented Interfaces:
    JsonValue, java.io.Serializable

    final class JsonValueImpl
    extends java.lang.Object
    implements JsonValue, java.io.Serializable
    Private implementation of JsonValue for simple JsonValue.ValueTypes allowing their usage in constants which are better to implement Serializable.
    • Constructor Detail

      • JsonValueImpl

        JsonValueImpl​(JsonValue.ValueType valueType)
        Default constructor.
        Parameters:
        valueType - Type of this JsonValue
    • Method Detail

      • equals

        public boolean equals​(java.lang.Object obj)
        Compares the specified object with this JsonValue object for equality. Returns true if and only if the specified object is also a JsonValue, and their getValueType() objects are equal.
        Overrides:
        equals in class java.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 this JsonValue object. The hash code of the JsonValue object is defined to be its getValueType() object's hash code.
        Overrides:
        hashCode in class java.lang.Object
        Returns:
        the hash code value for this JsonValue object
      • toString

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