Enum Class JSDataType

java.lang.Object
java.lang.Enum<JSDataType>
com.jbstrap.core.enums.JSDataType
All Implemented Interfaces:
Serializable, Comparable<JSDataType>, Constable

public enum JSDataType extends Enum<JSDataType>
Since:
4.0
Author:
JBStrap
  • Enum Constant Details

  • Method Details

    • values

      public static JSDataType[] values()
      Returns an array containing the constants of this enum class, in the order they are declared.
      Returns:
      an array containing the constants of this enum class, in the order they are declared
    • valueOf

      public static JSDataType valueOf(String name)
      Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (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 class has no constant with the specified name
      NullPointerException - if the argument is null
    • getJavaClass

      public Class<?> getJavaClass()
      Returns:
      The java class
    • getTypePrefix

      public String getTypePrefix()
      Returns:
      The JavaScript data type prefix
    • getName

      public String getName()
      Returns:
      The data type name
    • fromColumnDataType

      public static JSDataType fromColumnDataType(DataDescriptorColumnDatatype columnType)
      Parameters:
      columnType - The DataDescriptor column data type
      Returns:
      The assigned JavaScript data type
    • fromName

      public static JSDataType fromName(String name)
      Parameters:
      name - The data type name
      Returns:
      The assigned JavaScript data type
    • fromJavaClass

      public static JSDataType fromJavaClass(Class<?> javaClass)
      Parameters:
      javaClass - The java class
      Returns:
      The assigned JavaScript data type
    • fromObject

      public static JSDataType fromObject(Object data)
      Parameters:
      data - The data element
      Returns:
      The assigned JavaScript data type or null, if data null or unkndow data type
    • convert

      public Object convert(Object value)
      Converts the parameter values to a type that is compatible with the data type.
      Parameters:
      value - Values to be converted
      Returns:
      The parameter values converted to the data type