Class JSONBoolean


  • public class JSONBoolean
    extends JSONValue
    Represents a JSON boolean value.
    • Method Detail

      • getInstance

        public static JSONBoolean getInstance​(boolean b)
        Gets a reference to the singleton instance representing either true or false.
        Parameters:
        b - controls which value to get
        Returns:
        if true, the JSONBoolean instance representing true is returned; otherwise, the JSONBoolean instance representing false is returned
      • booleanValue

        public boolean booleanValue()
        Returns true if this is the instance representing "true", false otherwise.
      • isBoolean

        public JSONBoolean isBoolean()
        Returns this, as this is a JSONBoolean.
        Overrides:
        isBoolean in class JSONValue
        Returns:
        a reference to a JSONBoolean if this JSONValue is a JSONBoolean or null otherwise.
      • toString

        public java.lang.String toString()
        Returns "true" for the true value, and "false" for the false value.
        Specified by:
        toString in class JSONValue