Package jsonvalues
Class JsNothing
- java.lang.Object
-
- jsonvalues.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, likeJson.get(JsPath)
, return nothing when no element is found, what makes them total on the input path.
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
equals(java.lang.Object that)
Returns true if that is the singletonNOTHING
.int
hashCode()
Returns the hashcode of this JsNothing.int
id()
boolean
isNothing()
JsPrimitive
toJsPrimitive()
java.lang.String
toString()
-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface jsonvalues.JsValue
ifNothing, ifNull, isArray, isArray, isBigDec, isBigDec, isBigInt, isBigInt, isBinary, isBool, isDecimal, isDouble, isDouble, isFalse, isInstant, isInstant, isInt, isInt, isIntegral, isJson, isJson, isLong, isLong, isNotNothing, isNotNull, isNotNumber, isNull, isNumber, isObj, isObj, isPrimitive, isSameType, isStr, isStr, isTrue, toJsArray, toJsBigDec, toJsBigInt, toJsBinary, toJsBool, toJsDouble, toJsInstant, toJsInt, toJsLong, toJsNumber, toJsObj, toJson, toJsStr
-
-
-
-
Field Detail
-
TYPE_ID
public static final int TYPE_ID
- See Also:
- Constant Field Values
-
NOTHING
public static final JsNothing NOTHING
The singleton nothing value.
-
-
Method Detail
-
toJsPrimitive
public JsPrimitive toJsPrimitive()
- Specified by:
toJsPrimitive
in interfaceJsValue
-
isNothing
public boolean isNothing()
-
hashCode
public int hashCode()
Returns the hashcode of this JsNothing.- Overrides:
hashCode
in classjava.lang.Object
- Returns:
- 1
-
equals
public boolean equals(java.lang.Object that)
Returns true if that is the singletonNOTHING
.- Overrides:
equals
in classjava.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 classjava.lang.Object
- Returns:
- "NOTHING"
-
-