Class JSONObject.Null

java.lang.Object
org.json.JSONObject.Null
Enclosing class:
JSONObject

private static final class JSONObject.Null extends Object
JSONObject.NULL is equivalent to the value that JavaScript calls null, whilst Java's null is equivalent to the value that JavaScript calls undefined.
Version:
2016-08-15
  • Constructor Summary

    Constructors
    Modifier
    Constructor
    Description
    private
     
  • Method Summary

    Modifier and Type
    Method
    Description
    protected final Object
    There is only intended to be a single instance of the NULL object, so the clone method returns itself.
    boolean
    equals(Object object)
    A Null object is equal to the null value and to itself.
    int
    A Null object is equal to the null value and to itself.
    Get the "null" string value.

    Methods inherited from class Object

    finalize, getClass, notify, notifyAll, wait, wait, wait
  • Constructor Details

    • Null

      private Null()
  • Method Details

    • clone

      protected final Object clone()
      There is only intended to be a single instance of the NULL object, so the clone method returns itself.
      Overrides:
      clone in class Object
      Returns:
      NULL.
    • equals

      public boolean equals(Object object)
      A Null object is equal to the null value and to itself.
      Overrides:
      equals in class Object
      Parameters:
      object - An object to test for nullness.
      Returns:
      true if the object parameter is the JSONObject.NULL object or null.
    • hashCode

      public int hashCode()
      A Null object is equal to the null value and to itself.
      Overrides:
      hashCode in class Object
      Returns:
      always returns 0.
    • toString

      public String toString()
      Get the "null" string value.
      Overrides:
      toString in class Object
      Returns:
      The string "null".