Interface JsonPrimitive

All Superinterfaces:
JsonNode

public interface JsonPrimitive extends JsonNode
Interface that represents a JSON value.
  • Method Details

    • isValue

      default boolean isValue()
      Description copied from interface: JsonNode
      Indicates whether this JsonNode is an instance of JsonPrimitive ("string", 0, false, true).
      Specified by:
      isValue in interface JsonNode
      Returns:
      Whether this JsonNode is an instance of JsonPrimitive.
    • isBoolean

      boolean isBoolean()
      Indicates whether the JsonPrimitive represents a boolean (true, false).
      Returns:
      Whether the JsonPrimitive represents a boolean.
    • getAsBoolean

      boolean getAsBoolean()
      Gets the boolean value of the JsonPrimitive.
      Returns:
      The boolean value contained in the JsonPrimitive.
    • isNumber

      boolean isNumber()
      Indicates whether the JsonPrimitive represents a number (10, 10.0).
      Returns:
      Whether the JsonPrimitive represents a number.
    • getAsDouble

      double getAsDouble()
      Gets the double value of the JsonPrimitive.
      Returns:
      The double value contained in the JsonPrimitive.
    • getAsFloat

      float getAsFloat()
      Gets the float value of the JsonPrimitive.
      Returns:
      The float value contained in the JsonPrimitive.
    • getAsInt

      int getAsInt()
      Gets the int value of the JsonPrimitive.
      Returns:
      The int value contained in the JsonPrimitive.
    • getAsLong

      long getAsLong()
      Gets the long value of the JsonPrimitive.
      Returns:
      The long value contained in the JsonPrimitive.
    • getAsShort

      short getAsShort()
      Gets the short value of the JsonPrimitive.
      Returns:
      The short value contained in the JsonPrimitive.
    • isString

      boolean isString()
      Indicates whether the JsonPrimitive represents a string ("string").
      Returns:
      Whether the JsonPrimitive represents a string.
    • getAsString

      String getAsString()
      Gets the String value of the JsonPrimitive.
      Returns:
      The String value contained in the JsonPrimitive.