Interface JsonPrimitive
- All Superinterfaces:
JsonNode
Interface that represents a JSON value.
-
Method Summary
Modifier and TypeMethodDescriptionbooleanGets the boolean value of theJsonPrimitive.doubleGets the double value of theJsonPrimitive.floatGets the float value of theJsonPrimitive.intgetAsInt()Gets the int value of theJsonPrimitive.longGets the long value of theJsonPrimitive.shortGets the short value of theJsonPrimitive.Gets the String value of theJsonPrimitive.booleanIndicates whether theJsonPrimitiverepresents a boolean (true, false).booleanisNumber()Indicates whether theJsonPrimitiverepresents a number (10, 10.0).booleanisString()Indicates whether theJsonPrimitiverepresents a string ("string").default booleanisValue()
-
Method Details
-
isValue
default boolean isValue()Description copied from interface:JsonNode- Specified by:
isValuein interfaceJsonNode- Returns:
- Whether this
JsonNodeis an instance ofJsonPrimitive.
-
isBoolean
boolean isBoolean()Indicates whether theJsonPrimitiverepresents a boolean (true, false).- Returns:
- Whether the
JsonPrimitiverepresents a boolean.
-
getAsBoolean
boolean getAsBoolean()Gets the boolean value of theJsonPrimitive.- Returns:
- The boolean value contained in the
JsonPrimitive.
-
isNumber
boolean isNumber()Indicates whether theJsonPrimitiverepresents a number (10, 10.0).- Returns:
- Whether the
JsonPrimitiverepresents 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 theJsonPrimitiverepresents a string ("string").- Returns:
- Whether the
JsonPrimitiverepresents a string.
-
getAsString
String getAsString()Gets the String value of theJsonPrimitive.- Returns:
- The String value contained in the
JsonPrimitive.
-