Class JsonNull


public final class JsonNull extends JsonElement
A class representing a JSON null value.
Since:
1.2
Author:
Inderjeet Singh, Joel Leitch
  • Field Details

    • INSTANCE

      public static final JsonNull INSTANCE
      Singleton for JsonNull.
      Since:
      1.8
  • Constructor Details

    • JsonNull

      @Deprecated public JsonNull()
      Deprecated.
      Deprecated since Gson version 1.8, use INSTANCE instead.
      Creates a new JsonNull object.
  • Method Details

    • deepCopy

      public JsonNull deepCopy()
      Returns the same instance since it is an immutable value.
      Specified by:
      deepCopy in class JsonElement
      Since:
      2.8.2
    • hashCode

      public int hashCode()
      All instances of JsonNull have the same hash code since they are indistinguishable.
      Overrides:
      hashCode in class Object
    • equals

      public boolean equals(Object other)
      All instances of JsonNull are considered equal.
      Overrides:
      equals in class Object