Enum InstanceType

    • Enum Constant Detail

      • BOOLEAN

        public static final InstanceType BOOLEAN
        JSON true of false.
      • OBJECT

        public static final InstanceType OBJECT
        JSON object.
      • NUMBER

        public static final InstanceType NUMBER
        JSON number with or without fractional part.
      • STRING

        public static final InstanceType STRING
        JSON object.
      • INTEGER

        public static final InstanceType INTEGER
        JSON number without fractional part.
    • Method Detail

      • values

        public static InstanceType[] values()
        Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:
        for (InstanceType c : InstanceType.values())
            System.out.println(c);
        
        Returns:
        an array containing the constants of this enum type, in the order they are declared
      • valueOf

        public static InstanceType valueOf​(String name)
        Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)
        Parameters:
        name - the name of the enum constant to be returned.
        Returns:
        the enum constant with the specified name
        Throws:
        IllegalArgumentException - if this enum type has no constant with the specified name
        NullPointerException - if the argument is null
      • isNumeric

        public boolean isNumeric()
        Checks if this type is numeric or not.
        Returns:
        true if this type is numeric, false otherwise.
      • isContainer

        public boolean isContainer()
        Checks if this type can contain other types or not. A container is either JSON array or JSON object.
        Returns:
        true if this type is container, false otherwise.
      • of

        public static InstanceType of​(JsonValue value)
        Returns the type of the specified JSON value.
        Parameters:
        value - the JSON value whose type will be returned.
        Returns:
        the type of the JSON value.
        Throws:
        NullPointerException - if the specified value is null.