class JsonLiteral extends JsonValue
| Modifier and Type | Field and Description |
|---|---|
private boolean |
isFalse |
private boolean |
isNull |
private boolean |
isTrue |
private String |
value |
TRANSFORM_LINE_LENGTH| Constructor and Description |
|---|
JsonLiteral(String value) |
| Modifier and Type | Method and Description |
|---|---|
boolean |
asBoolean()
Returns this JSON value as a
boolean value, assuming that this value is either
true or false. |
boolean |
equals(Object object)
Indicates whether some other object is "equal to" this one according to the contract specified
in
Object.equals(Object). |
int |
hashCode() |
boolean |
isBoolean()
Detects whether this value represents a boolean value.
|
boolean |
isFalse()
Detects whether this value represents the JSON literal
false. |
boolean |
isNull()
Detects whether this value represents the JSON literal
null. |
boolean |
isTrue()
Detects whether this value represents the JSON literal
true. |
String |
toString()
Returns the JSON string for this value in its minimal form, without any additional whitespace.
|
(package private) void |
write(JsonWriter writer) |
private final String value
private final boolean isNull
private final boolean isTrue
private final boolean isFalse
JsonLiteral(String value)
void write(JsonWriter writer) throws IOException
write in class JsonValueIOExceptionpublic String toString()
JsonValue#readFrom(String) and to
create a value that is equal to this object.public boolean isNull()
JsonValuenull.public boolean isTrue()
JsonValuetrue.public boolean isFalse()
JsonValuefalse.public boolean isBoolean()
JsonValuepublic boolean asBoolean()
JsonValueboolean value, assuming that this value is either
true or false. If this is not the case, an exception is thrown.public boolean equals(Object object)
JsonValueObject.equals(Object).
Two JsonValues are considered equal if and only if they represent the same JSON text. As a consequence, two given JsonObjects may be different even though they contain the same set of names with the same values, but in a different order.
Copyright © 2011–2016 David R. Smith. All rights reserved.