Package jsonvalues

Class JsNothing

  • All Implemented Interfaces:
    JsValue

    public final class JsNothing
    extends java.lang.Object
    implements JsValue
    It's a special json element that represents 'nothing'. Inserting nothing in a json leaves the json unchanged. The functions that return a JsValue, like Json.get(JsPath), return nothing when no element is found, what makes them total on the input path.
    • Method Detail

      • id

        public int id()
        Specified by:
        id in interface JsValue
      • isNothing

        public boolean isNothing()
        Description copied from interface: JsValue
        Returns true if this element is JsNothing
        Specified by:
        isNothing in interface JsValue
        Returns:
        true if this element is JsNothing
      • hashCode

        public int hashCode()
        Returns the hashcode of this JsNothing.
        Overrides:
        hashCode in class java.lang.Object
        Returns:
        1
      • equals

        public boolean equals​(java.lang.Object that)
        Returns true if that is the singleton NOTHING.
        Overrides:
        equals in class java.lang.Object
        Parameters:
        that - the reference object with which to compare.
        Returns:
        true if that is NOTHING
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object
        Returns:
        "NOTHING"