Enum ColumnType

  • All Implemented Interfaces:
    java.io.Serializable, java.lang.Comparable<ColumnType>

    public enum ColumnType
    extends java.lang.Enum<ColumnType>
    • Field Detail

      • mariadbType

        private final short mariadbType
      • javaType

        private final int javaType
      • javaTypeName

        private final java.lang.String javaTypeName
      • className

        private final java.lang.String className
    • Constructor Detail

      • ColumnType

        private ColumnType​(int mariadbType,
                           int javaType,
                           java.lang.String javaTypeName,
                           java.lang.String className)
    • Method Detail

      • values

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

        public static ColumnType valueOf​(java.lang.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:
        java.lang.IllegalArgumentException - if this enum type has no constant with the specified name
        java.lang.NullPointerException - if the argument is null
      • classFromJavaType

        public static java.lang.Class classFromJavaType​(int type)
        Permit to know java result class according to java.sql.Types.
        Parameters:
        type - java.sql.Type value
        Returns:
        Class name.
      • isNumeric

        public static boolean isNumeric​(ColumnType type)
        Is type numeric.
        Parameters:
        type - mariadb type
        Returns:
        true if type is numeric
      • getColumnTypeName

        public static java.lang.String getColumnTypeName​(ColumnType type,
                                                         long len,
                                                         long charLen,
                                                         boolean signed,
                                                         boolean binary)
        Get columnTypeName.
        Parameters:
        type - type
        len - len
        charLen - character length
        signed - signed
        binary - binary
        Returns:
        type
      • fromServer

        public static ColumnType fromServer​(int typeValue,
                                            int charsetNumber)
        Convert server Type to server type.
        Parameters:
        typeValue - type value
        charsetNumber - charset
        Returns:
        MariaDb type
      • toServer

        public static ColumnType toServer​(int javaType)
        Convert javatype to ColumnType.
        Parameters:
        javaType - javatype value
        Returns:
        mariaDb type value
      • getClassName

        public static java.lang.String getClassName​(ColumnType type,
                                                    int len,
                                                    boolean signed,
                                                    boolean binary,
                                                    Options options)
        Get class name.
        Parameters:
        type - type
        len - len
        signed - signed
        binary - binary
        options - options
        Returns:
        class name
      • getClassName

        public java.lang.String getClassName()
      • getSqlType

        public int getSqlType()
      • getTypeName

        public java.lang.String getTypeName()
      • getType

        public short getType()
      • getJavaTypeName

        public java.lang.String getJavaTypeName()