Package jsonvalues

Class JsNothing

  • All Implemented Interfaces:
    JsElem

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

      • NOTHING

        public static final JsNothing NOTHING
        The singleton nothing value.
    • Method Detail

      • equals

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

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

        public boolean isObj()
        Specified by:
        isObj in interface JsElem
        Returns:
        true if this JsElem is a JsObj
      • isArray

        public boolean isArray()
        Specified by:
        isArray in interface JsElem
        Returns:
        true if this JsElem is a JsArray
      • isNothing

        public boolean isNothing()
        Specified by:
        isNothing in interface JsElem
        Returns:
        true if this element is JsNothing
      • isNull

        public boolean isNull()
        Specified by:
        isNull in interface JsElem
        Returns:
        true if this element is null
      • isNumber

        public boolean isNumber()
        Specified by:
        isNumber in interface JsElem
        Returns:
        true if this element is a number
      • isBool

        public boolean isBool()
        Specified by:
        isBool in interface JsElem
        Returns:
        true if this JsElem is a JsBool
      • isTrue

        public boolean isTrue()
        Specified by:
        isTrue in interface JsElem
        Returns:
        true if this JsElem is a JsBool and it's true
      • isFalse

        public boolean isFalse()
        Specified by:
        isFalse in interface JsElem
        Returns:
        true if this JsElem is a JsBool and it's false
      • isInt

        public boolean isInt()
        Specified by:
        isInt in interface JsElem
        Returns:
        true if this JsElem is a JsInt
      • isDouble

        public boolean isDouble()
        Specified by:
        isDouble in interface JsElem
        Returns:
        true if this JsElem is a JsDouble
      • isBigDec

        public boolean isBigDec()
        Specified by:
        isBigDec in interface JsElem
        Returns:
        true if this JsElem is a JsBigDec
      • isLong

        public boolean isLong()
        Specified by:
        isLong in interface JsElem
        Returns:
        true if this JsElem is a JsLong
      • isStr

        public boolean isStr()
        Specified by:
        isStr in interface JsElem
        Returns:
        true if this JsElem is a JsStr
      • isBigInt

        public boolean isBigInt()
        Specified by:
        isBigInt in interface JsElem
        Returns:
        true if this JsElem is a JsBigInt