Package jsonvalues
Class JsBool
- java.lang.Object
-
- jsonvalues.JsPrimitive
-
- jsonvalues.JsBool
-
- All Implemented Interfaces:
JsValue
public final class JsBool extends JsPrimitive
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
equals(java.lang.Object that)
Indicates whether some other object is "equal to" this json boolean.int
hashCode()
Returns the hashcode of this json boolean.int
id()
boolean
isBool()
Returns true if this JsValue is a JsBoolboolean
isFalse()
Returns true if this JsValue is a JsBool, and it's falseboolean
isTrue()
Returns true if this JsValue is a JsBool, and it's truestatic JsBool
of(boolean b)
Static factory method to create a JsBool from a boolean primitive type.JsPrimitive
toJsPrimitive()
java.lang.String
toString()
-
Methods inherited from class jsonvalues.JsPrimitive
isJson, isPrimitive
-
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, isDecimal, isDouble, isDouble, isInstant, isInstant, isInt, isInt, isIntegral, isJson, isLong, isLong, isNothing, isNotNothing, isNotNull, isNotNumber, isNull, isNumber, isObj, isObj, isSameType, isStr, isStr, 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
-
FALSE
public static final JsBool FALSE
The singleton false value.
-
TRUE
public static final JsBool TRUE
The singleton true value.
-
prism
public static final Prism<JsValue,java.lang.Boolean> prism
prism between the sum type JsValue and JsBool
-
value
public final boolean value
the boolean value.
-
-
Method Detail
-
of
public static JsBool of(boolean b)
Static factory method to create a JsBool from a boolean primitive type.
-
id
public int id()
-
toJsPrimitive
public JsPrimitive toJsPrimitive()
-
isBool
public boolean isBool()
Description copied from interface:JsValue
Returns true if this JsValue is a JsBool- Returns:
- true if this JsValue is a JsBool
-
isTrue
public boolean isTrue()
Description copied from interface:JsValue
Returns true if this JsValue is a JsBool, and it's true- Returns:
- true if this JsValue is a JsBool, and it's true
-
isFalse
public boolean isFalse()
Description copied from interface:JsValue
Returns true if this JsValue is a JsBool, and it's false- Returns:
- true if this JsValue is a JsBool, and it's false
-
hashCode
public int hashCode()
Returns the hashcode of this json boolean.- Overrides:
hashCode
in classjava.lang.Object
- Returns:
- 1 if true, 0 if false
-
equals
public boolean equals(java.lang.Object that)
Indicates whether some other object is "equal to" this json boolean.- Overrides:
equals
in classjava.lang.Object
- Parameters:
that
- the reference object with which to compare.- Returns:
- true if
that
is a JsBool with the same value asthis
JsBool
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
- Returns:
- "true" or "false"
-
-