Interface JsonElement

All Known Subinterfaces:
JsonObject

public interface JsonElement
A generic element
Author:
Riccardo Balbo
  • Method Details

    • getAsString

      String getAsString()
      Returns the object as a String
      Returns:
      the string
    • getAsJsonObject

      JsonObject getAsJsonObject()
      Returns the object as a JsonObject
      Returns:
      the JsonObject
    • getAsFloat

      float getAsFloat()
      Returns the object as a float
      Returns:
      the float
    • getAsInt

      int getAsInt()
      Returns the object as an int
      Returns:
      the int
    • getAsBoolean

      boolean getAsBoolean()
      Returns the object as a boolean
      Returns:
      the boolean
    • getAsJsonArray

      JsonArray getAsJsonArray()
      Returns the object as a JsonArray
      Returns:
      the JsonArray
    • getAsNumber

      Number getAsNumber()
      Returns the object as a Number
      Returns:
      the Number
    • getAsJsonPrimitive

      JsonPrimitive getAsJsonPrimitive()
      Returns the object as a JsonPrimitive
      Returns:
      the json primitive
    • autoCast

      <T extends JsonElement> T autoCast()
      Cast this JsonElement to a specific type
      Returns:
      the casted JsonElement
    • isJsonObject

      default boolean isJsonObject()
      Check if this element is a JsonObject
      Returns:
      true if this element is a JsonObject, false otherwise
    • isJsonArray

      default boolean isJsonArray()
      Check if this element is a JsonArray
      Returns:
      true if this element is a JsonArray, false otherwise
    • isJsonPrimitive

      default boolean isJsonPrimitive()
      Check if this element is a JsonPrimitive
      Returns:
      true if this element is a JsonPrimitive, false otherwise
    • isJsonNull

      default boolean isJsonNull()
      Check if this element is a JSON null
      Returns:
      true if this element represents a null value, false otherwise