|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.unboundid.util.json.JSONValue
com.unboundid.util.json.JSONBoolean
@NotMutable @ThreadSafety(level=COMPLETELY_THREADSAFE) public final class JSONBoolean
This class provides an implementation of a JSON value that represents a
Java Boolean. The string representation of the JSON Boolean true value is
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.
Field Summary | |
---|---|
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 Summary | |
---|---|
JSONBoolean(boolean booleanValue)
Creates a new JSON value capable of representing a Boolean value of either true or false . |
Method Summary | |
---|---|
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 value. |
void |
toNormalizedString(java.lang.StringBuilder buffer)
Appends a normalized string representation of this value to the provided buffer. |
java.lang.String |
toSingleLineString()
Retrieves a single-line string representation of this value as it should appear in a JSON object, including any necessary quoting, escaping, etc. |
void |
toSingleLineString(java.lang.StringBuilder buffer)
Appends a single-line string representation of this value (as it should appear in a JSON object, including any necessary quoting, escaping, etc.) to the provided buffer. |
java.lang.String |
toString()
Retrieves a string representation of this value as it should appear in a JSON object, including any necessary quoting, escaping, etc. |
void |
toString(java.lang.StringBuilder buffer)
Appends a string representation of this value (as it should appear in a JSON object, including any necessary quoting, escaping, etc.) to the provided buffer. |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static final JSONBoolean FALSE
false
.
public static final JSONBoolean TRUE
true
.
Constructor Detail |
---|
public JSONBoolean(boolean booleanValue)
true
or false
.
booleanValue
- The Boolean value for this JSON value.Method Detail |
---|
public boolean booleanValue()
public int hashCode()
hashCode
in class JSONValue
public boolean equals(java.lang.Object o)
equals
in class JSONValue
o
- The object to compare against this JSON value.
true
if the provided object is considered equal to this
JSON value, or false
if not.public boolean equals(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.public java.lang.String toString()
toString
in class JSONValue
public void toString(java.lang.StringBuilder buffer)
toString
in class JSONValue
buffer
- The buffer to which the information should be appended.public java.lang.String toSingleLineString()
toSingleLineString
in class JSONValue
public void toSingleLineString(java.lang.StringBuilder buffer)
toSingleLineString
in class JSONValue
buffer
- The buffer to which the information should be appended.public java.lang.String toNormalizedString()
toNormalizedString
in class JSONValue
public void toNormalizedString(java.lang.StringBuilder buffer)
toNormalizedString
in class JSONValue
buffer
- The buffer to which the information should be appended.public void appendToJSONBuffer(JSONBuffer buffer)
appendToJSONBuffer
in class JSONValue
buffer
- The JSON buffer to which this value should be appended.public void appendToJSONBuffer(java.lang.String fieldName, 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.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |