Class JSONObject.Null

  • Enclosing class:
    JSONObject

    private static final class JSONObject.Null
    extends java.lang.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.
    • Field Summary

      Fields 
      Modifier and Type Field Description
      (package private) boolean explicitNull  
    • Constructor Summary

      Constructors 
      Constructor Description
      Null()  
      Null​(boolean explicitNull)  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      protected java.lang.Object clone()
      There is only intended to be a single instance of the NULL object, so the clone method returns itself.
      boolean equals​(java.lang.Object object)
      A Null object is equal to the null value and to itself.
      boolean isExplicitNull()  
      java.lang.String toString()
      Get the "null" string value.
      • Methods inherited from class java.lang.Object

        finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
    • Field Detail

      • explicitNull

        boolean explicitNull
    • Constructor Detail

      • Null

        public Null()
      • Null

        public Null​(boolean explicitNull)
    • Method Detail

      • clone

        protected final java.lang.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 java.lang.Object
        Returns:
        NULL.
      • equals

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

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

        public boolean isExplicitNull()