Interface JsonPrimitive
- All Superinterfaces:
JsonNode
Interface that represents a JSON value.
-
Method Summary
Modifier and TypeMethodDescriptionboolean
Gets the boolean value of theJsonPrimitive
.double
Gets the double value of theJsonPrimitive
.float
Gets the float value of theJsonPrimitive
.int
getAsInt()
Gets the int value of theJsonPrimitive
.long
Gets the long value of theJsonPrimitive
.short
Gets the short value of theJsonPrimitive
.Gets the String value of theJsonPrimitive
.boolean
Indicates whether theJsonPrimitive
represents a boolean (true, false
).boolean
isNumber()
Indicates whether theJsonPrimitive
represents a number (10, 10.0
).boolean
isString()
Indicates whether theJsonPrimitive
represents a string ("string"
).default boolean
isValue()
-
Method Details
-
isValue
default boolean isValue()Description copied from interface:JsonNode
- Specified by:
isValue
in interfaceJsonNode
- Returns:
- Whether this
JsonNode
is an instance ofJsonPrimitive
.
-
isBoolean
boolean isBoolean()Indicates whether theJsonPrimitive
represents a boolean (true, false
).- Returns:
- Whether the
JsonPrimitive
represents a boolean.
-
getAsBoolean
boolean getAsBoolean()Gets the boolean value of theJsonPrimitive
.- Returns:
- The boolean value contained in the
JsonPrimitive
.
-
isNumber
boolean isNumber()Indicates whether theJsonPrimitive
represents a number (10, 10.0
).- Returns:
- Whether the
JsonPrimitive
represents a number.
-
getAsDouble
double getAsDouble()Gets the double value of theJsonPrimitive
.- Returns:
- The double value contained in the
JsonPrimitive
.
-
getAsFloat
float getAsFloat()Gets the float value of theJsonPrimitive
.- Returns:
- The float value contained in the
JsonPrimitive
.
-
getAsInt
int getAsInt()Gets the int value of theJsonPrimitive
.- Returns:
- The int value contained in the
JsonPrimitive
.
-
getAsLong
long getAsLong()Gets the long value of theJsonPrimitive
.- Returns:
- The long value contained in the
JsonPrimitive
.
-
getAsShort
short getAsShort()Gets the short value of theJsonPrimitive
.- Returns:
- The short value contained in the
JsonPrimitive
.
-
isString
boolean isString()Indicates whether theJsonPrimitive
represents a string ("string"
).- Returns:
- Whether the
JsonPrimitive
represents a string.
-
getAsString
String getAsString()Gets the String value of theJsonPrimitive
.- Returns:
- The String value contained in the
JsonPrimitive
.
-