Class JsonBoolean
java.lang.Object
com.revetsec.json.JsonBoolean
- All Implemented Interfaces:
JsonValue
A JSON
true or false. There are exactly two instances.- Since:
- 1.0.0
- Author:
- Mark Allen
-
Method Summary
Modifier and TypeMethodDescriptionbooleanstatic @NonNull JsonBooleanReturns the JSONfalse.static @NonNull JsonBooleanReturns the JSON boolean forvalue.getValue()Returns this boolean's value.inthashCode()toJson()Serializes this value as compact JSON text: no insignificant whitespace, members in insertion order, and numbers in the canonical form ofBigDecimal.toString()(1e2becomes1E+2).toString()static @NonNull JsonBooleanReturns the JSONtrue.
-
Method Details
-
trueInstance
Returns the JSONtrue.- Returns:
- the shared instance for
true - Since:
- 1.0.0
-
falseInstance
Returns the JSONfalse.- Returns:
- the shared instance for
false - Since:
- 1.0.0
-
fromValue
Returns the JSON boolean forvalue.- Parameters:
value- the boolean- Returns:
trueInstance()orfalseInstance()- Throws:
NullPointerException- ifvalueisnull- Since:
- 1.0.0
-
getValue
-
toJson
Description copied from interface:JsonValueSerializes this value as compact JSON text: no insignificant whitespace, members in insertion order, and numbers in the canonical form ofBigDecimal.toString()(1e2becomes1E+2).Strings escape only what JSON requires: the quotation mark, the reverse solidus and the control characters U+0000 to U+001F, using the two-character escapes where they exist. Every other character, U+2028 and U+2029 included, is written as itself.
Unlike
toString(), the result contains every string and number this value holds. It is not the text a value was parsed from, so never verify a signature over it. -
equals
-
hashCode
-
toString
-