Class JsonBoolean

java.lang.Object
name.martingeisse.grumpyjson.json_model.JsonElement
name.martingeisse.grumpyjson.json_model.JsonBoolean

public final class JsonBoolean extends JsonElement
This class represents the JSON values true and false.
  • Field Details

    • TRUE

      public static final JsonBoolean TRUE
      The JSON true value
    • FALSE

      public static final JsonBoolean FALSE
      The JSON false value
  • Method Details

    • of

      public static JsonBoolean of(boolean value)
      Returns an instance of this class for a plain boolean value.
      Parameters:
      value - the boolean value
      Returns:
      the JSON boolean for that value
    • getValue

      public boolean getValue()
      Getter method.
      Returns:
      the value of this JSON boolean
    • deserializerExpectsBoolean

      public boolean deserializerExpectsBoolean()
      Description copied from class: JsonElement
      If this JSON element is not a JSON boolean, this method throws a JsonDeserializationException, otherwise it returns the boolean value.
      Overrides:
      deserializerExpectsBoolean in class JsonElement
      Returns:
      the boolean value
    • equals

      public boolean equals(Object obj)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • toString

      public String toString()
      Overrides:
      toString in class Object