@NotMutable @ThreadSafety(level=COMPLETELY_THREADSAFE) public final class JSONBoolean extends JSONValue
true
, and the string representation of the JSON Boolean false value
is false
. These values are not surrounded by quotation marks, and
they must be entirely lowercase.Modifier and Type | Field and Description |
---|---|
static JSONBoolean |
FALSE
A pre-allocated object that represents a value of
false . |
static JSONBoolean |
TRUE
A pre-allocated object that represents a value of
true . |
Constructor and Description |
---|
JSONBoolean(boolean booleanValue)
Creates a new JSON value capable of representing a Boolean value of either
true or false . |
Modifier and Type | Method and Description |
---|---|
void |
appendToJSONBuffer(JSONBuffer buffer)
Appends this value to the provided JSON buffer.
|
void |
appendToJSONBuffer(java.lang.String fieldName,
JSONBuffer buffer)
Appends a field with the given name and this value to the provided JSON
buffer.
|
boolean |
booleanValue()
Retrieves the Java boolean value for this JSON value.
|
boolean |
equals(JSONValue v,
boolean ignoreFieldNameCase,
boolean ignoreValueCase,
boolean ignoreArrayOrder)
Indicates whether this JSON value is considered equal to the provided JSON
value, subject to the specified constraints.
|
boolean |
equals(java.lang.Object o)
Indicates whether the provided object is equal to this JSON value.
|
int |
hashCode()
Retrieves a hash code for this JSON value.
|
java.lang.String |
toNormalizedString()
Retrieves a normalized string representation of this Boolean value as it
should appear in a JSON object.
|
java.lang.String |
toNormalizedString(boolean ignoreFieldNameCase,
boolean ignoreValueCase,
boolean ignoreArrayOrder)
Retrieves a normalized string representation of this Boolean value as it
should appear in a JSON object.
|
void |
toNormalizedString(java.lang.StringBuilder buffer)
Appends a normalized string representation of this Boolean value as it
should appear in a JSON object to the provided buffer.
|
void |
toNormalizedString(java.lang.StringBuilder buffer,
boolean ignoreFieldNameCase,
boolean ignoreValueCase,
boolean ignoreArrayOrder)
Appends a normalized string representation of this Boolean value as it
should appear in a JSON object to the provided buffer.
|
JSONBoolean |
toNormalizedValue(boolean ignoreFieldNameCase,
boolean ignoreValueCase,
boolean ignoreArrayOrder)
Retrieves a normalized representation of this value using the provided
settings.
|
java.lang.String |
toSingleLineString()
Retrieves a single-line string representation of this Boolean value as it
should appear in a JSON object.
|
void |
toSingleLineString(java.lang.StringBuilder buffer)
Appends a single-line string representation of this Boolean value as it
should appear in a JSON object to the provided buffer.
|
java.lang.String |
toString()
Retrieves a string representation of this Boolean value as it should appear
in a JSON object.
|
void |
toString(java.lang.StringBuilder buffer)
Appends a string representation of this Boolean value as it should appear
in a JSON object to the provided buffer.
|
@NotNull public static final JSONBoolean FALSE
false
.@NotNull public static final JSONBoolean TRUE
true
.public JSONBoolean(boolean booleanValue)
true
or false
.booleanValue
- The Boolean value for this JSON value.public boolean booleanValue()
public int hashCode()
public boolean equals(@Nullable java.lang.Object o)
public boolean equals(@NotNull JSONValue v, boolean ignoreFieldNameCase, boolean ignoreValueCase, boolean ignoreArrayOrder)
equals
in class JSONValue
v
- The JSON value for which to make the
determination. It must not be null
.ignoreFieldNameCase
- Indicates whether to ignore differences in the
capitalization of JSON field names.ignoreValueCase
- Indicates whether to ignore differences in
the capitalization of JSON values that
represent strings.ignoreArrayOrder
- Indicates whether to ignore differences in the
order of elements in JSON arrays.true
if this JSON value is considered equal to the
provided JSON value (subject to the specified constraints), or
false
if not.@NotNull public java.lang.String toString()
true
, then the string
representation will be "true
" (without the surrounding quotes). If
the Boolean value is false
, then the string representation will be
"false
" (again, without the quotes).public void toString(@NotNull java.lang.StringBuilder buffer)
true
, then the string representation will be "true
"
(without the surrounding quotes). If the Boolean value is false
,
then the string representation will be "false
" (again, without the
quotes).@NotNull public java.lang.String toSingleLineString()
true
, then
the string representation will be "true
" (without the surrounding
quotes). If the Boolean value is false
, then the string
representation will be "false
" (again, without the quotes).toSingleLineString
in class JSONValue
public void toSingleLineString(@NotNull java.lang.StringBuilder buffer)
true
, then the string representation will be
"true
" (without the surrounding quotes). If the Boolean value is
false
, then the string representation will be "false
"
(again, without the quotes).toSingleLineString
in class JSONValue
buffer
- The buffer to which the information should be appended.@NotNull public java.lang.String toNormalizedString()
true
, then
the string representation will be "true
" (without the surrounding
quotes). If the Boolean value is false
, then the string
representation will be "false
" (again, without the quotes).toNormalizedString
in class JSONValue
public void toNormalizedString(@NotNull java.lang.StringBuilder buffer)
true
, then the string representation will be
"true
" (without the surrounding quotes). If the Boolean value is
false
, then the string representation will be "false
"
(again, without the quotes).toNormalizedString
in class JSONValue
buffer
- The buffer to which the information should be appended.@NotNull public java.lang.String toNormalizedString(boolean ignoreFieldNameCase, boolean ignoreValueCase, boolean ignoreArrayOrder)
true
, then
the string representation will be "true
" (without the surrounding
quotes). If the Boolean value is false
, then the string
representation will be "false
" (again, without the quotes).toNormalizedString
in class JSONValue
ignoreFieldNameCase
- Indicates whether field names should be
treated in a case-sensitive (if false
)
or case-insensitive (if true
) manner.ignoreValueCase
- Indicates whether string field values should
be treated in a case-sensitive (if
false
) or case-insensitive (if
true
) manner.ignoreArrayOrder
- Indicates whether the order of elements in an
array should be considered significant (if
false
) or insignificant (if
true
).public void toNormalizedString(@NotNull java.lang.StringBuilder buffer, boolean ignoreFieldNameCase, boolean ignoreValueCase, boolean ignoreArrayOrder)
true
, then the string representation will be
"true
" (without the surrounding quotes). If the Boolean value is
false
, then the string representation will be "false
"
(again, without the quotes).toNormalizedString
in class JSONValue
buffer
- The buffer to which the information should be
appended.ignoreFieldNameCase
- Indicates whether field names should be
treated in a case-sensitive (if false
)
or case-insensitive (if true
) manner.ignoreValueCase
- Indicates whether string field values should
be treated in a case-sensitive (if
false
) or case-insensitive (if
true
) manner.ignoreArrayOrder
- Indicates whether the order of elements in an
array should be considered significant (if
false
) or insignificant (if
true
).@NotNull public JSONBoolean toNormalizedValue(boolean ignoreFieldNameCase, boolean ignoreValueCase, boolean ignoreArrayOrder)
toNormalizedValue
in class JSONValue
ignoreFieldNameCase
- Indicates whether field names should be
treated in a case-sensitive (if false
)
or case-insensitive (if true
) manner.ignoreValueCase
- Indicates whether string field values should
be treated in a case-sensitive (if
false
) or case-insensitive (if
true
) manner.ignoreArrayOrder
- Indicates whether the order of elements in an
array should be considered significant (if
false
) or insignificant (if
true
).public void appendToJSONBuffer(@NotNull JSONBuffer buffer)
appendToJSONBuffer
in class JSONValue
buffer
- The JSON buffer to which this value should be appended.public void appendToJSONBuffer(@NotNull java.lang.String fieldName, @NotNull JSONBuffer buffer)
appendToJSONBuffer
in class JSONValue
fieldName
- The name to use for the field.buffer
- The JSON buffer to which this value should be appended.