Enum DataType

    • Enum Constant Detail

      • STRING

        public static final DataType STRING
        a string value.
      • NUMERIC

        public static final DataType NUMERIC
        a numeric value.
      • BOOLEAN

        public static final DataType BOOLEAN
        a boolean value.
      • UNKNOWN

        public static final DataType UNKNOWN
        unknown type.
    • Method Detail

      • values

        public static DataType[] 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 (DataType c : DataType.values())
            System.out.println(c);
        
        Returns:
        an array containing the constants of this enum type, in the order they are declared
      • valueOf

        public static DataType 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
      • toString

        public String toString()
        Returns the display string.
        Overrides:
        toString in class Enum<DataType>
        Returns:
        the display string
      • parse

        public DataType parse​(String s)
        Parses the given string and returns the associated enum.
        Specified by:
        parse in interface EnumWithCustomParsing<DataType>
        Parameters:
        s - the string to parse
        Returns:
        the enum or null if not found
      • toString

        public static String toString​(AbstractOption option,
                                      Object object)
        Returns the enum as string.
        Parameters:
        option - the current option
        object - the enum object to convert
        Returns:
        the generated string
      • valueOf

        public static DataType valueOf​(AbstractOption option,
                                       String str)
        Returns an enum generated from the string.
        Parameters:
        option - the current option
        str - the string to convert to an enum
        Returns:
        the generated enum or null in case of error
      • guessType

        public static DataType guessType​(Object obj)
        Guesses the data type from the object. In case of string, it checks for: boolean -> double -> string
        Parameters:
        obj - the object to inspect
        Returns:
        the data type