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