Enum Class ColumnType

java.lang.Object
java.lang.Enum<ColumnType>
studio.magemonkey.codex.mccore.sql.ColumnType
All Implemented Interfaces:
Serializable, Comparable<ColumnType>, Constable

public enum ColumnType extends Enum<ColumnType>
Types of columns supported
  • Enum Constant Details

    • STRING_16

      public static final ColumnType STRING_16

      A string that can be up to 16 characters long

    • STRING_32

      public static final ColumnType STRING_32
      A string that can be up to 32 characters long
    • STRING_64

      public static final ColumnType STRING_64

      A string that can be up to 64 characters long

    • STRING_128

      public static final ColumnType STRING_128

      A string that can be up to 128 characters long

    • STRING_255

      public static final ColumnType STRING_255

      A string that can be up to 256 characters long

    • TEXT

      public static final ColumnType TEXT

      A string that can be up to 64KB or 65,535 characters long

    • MEDIUM_TEXT

      public static final ColumnType MEDIUM_TEXT
      Text that can store up to 16MB or 16,777,215 characters
    • INT

      public static final ColumnType INT
      A standard integer
    • LONG

      public static final ColumnType LONG
      A standard long
    • FLOAT

      public static final ColumnType FLOAT

      A standard 4-byte float value

    • DOUBLE

      public static final ColumnType DOUBLE

      A standard 8-byte double value

    • INCREMENT

      public static final ColumnType INCREMENT

      A integer increment to put a number ID on each entry

    • DATE_TIME

      public static final ColumnType DATE_TIME

      A date/time value in the format YYYY-MM-DD HH:MM:SS

  • Method Details

    • values

      public static ColumnType[] 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 ColumnType 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
    • getByValues

      public static ColumnType getByValues(String type, int size)

      Retrieves a column type by name and size values.

      If no supported type matches the data, this will return null instead.

      Parameters:
      type - type of the column
      size - size of the column
      Returns:
      column type representation
    • toString

      public String toString()
      Overrides:
      toString in class Enum<ColumnType>
      Returns:
      type key