Package acdp.design

Class ST

java.lang.Object
acdp.design.ST

public final class ST extends Object
Provides factory methods which return a built-in simple column type that can be used as second argument of the CL.ofArray(int, SimpleType) method.
Author:
Beat Hörmann
  • Method Details

    • beBoolean

      public static final SimpleType<Boolean> beBoolean(ST.Nulls nulls)
      Returns the column type analogon of a Java boolean or Boolean type. It is safe to cast the returned value to the BooleanType interface.
      Parameters:
      nulls - Must be set to Nulls.NULLABLE if the type allows the null value, Nulls.NO_NULL if not.
      Returns:
      The Boolean column type.
    • beByte

      public static final SimpleType<Byte> beByte(ST.Nulls nulls)
      Returns the column type analogon of a Java byte or Byte type. It is safe to cast the returned value to the ByteType interface.
      Parameters:
      nulls - Must be set to Nulls.NULLABLE if the type allows the null value, Nulls.NO_NULL if not.
      Returns:
      The Byte column type.
    • beShort

      public static final SimpleType<Short> beShort(ST.Nulls nulls)
      Returns the column type analogon of a Java short or Short type. It is safe to cast the returned value to the ShortType interface.
      Parameters:
      nulls - Must be set to Nulls.NULLABLE if the type allows the null value, Nulls.NO_NULL if not.
      Returns:
      The Short column type.
    • beInteger

      public static final SimpleType<Integer> beInteger(ST.Nulls nulls)
      Returns column type analogon of a Java int or Integer type. It is safe to cast the returned value to the IntegerType interface.
      Parameters:
      nulls - Must be set to Nulls.NULLABLE if the type allows the null value, Nulls.NO_NULL if not.
      Returns:
      The Integer column type.
    • beLong

      public static final SimpleType<Long> beLong(ST.Nulls nulls)
      Returns the column type analogon of a Java long or Long type. It is safe to cast the returned value to the LongType interface.
      Parameters:
      nulls - Must be set to Nulls.NULLABLE if the type allows the null value, Nulls.NO_NULL if not.
      Returns:
      The Long column type.
    • beFloat

      public static final SimpleType<Float> beFloat(ST.Nulls nulls)
      Returns the column type analogon of a Java float or Float type. It is safe to cast the returned value to the FloatType interface.
      Parameters:
      nulls - Must be set to Nulls.NULLABLE if the type allows the null value, Nulls.NO_NULL if not.
      Returns:
      The Float column type.
    • beDouble

      public static final SimpleType<Double> beDouble(ST.Nulls nulls)
      Returns the column type analogon of a Java double or Double type. It is safe to cast the returned value to the DoubleType interface.
      Parameters:
      nulls - Must be set to Nulls.NULLABLE if the type allows the null value, Nulls.NO_NULL if not.
      Returns:
      The Double column type.
    • beString

      public static final SimpleType<String> beString()
      Returns the column type analogon of a Java String type. It is safe to cast the returned value to the StringType interface.

      Invoking this method has the same effect as invoking beString(Nulls.NULLABLE, OutrowStringLength.GIANT).

      Returns:
      The String column type.
    • beString

      public static final SimpleType<String> beString(ST.Nulls nulls, ST.OutrowStringLength length)
      Returns the String column type with an outrow storage scheme and applying the "UTF-8" charset for any byte conversions. It is safe to cast the returned value to the StringType interface.

      Invoking this method has the same effect as invoking beString(StandardCharsets.UTF_8, nulls, length).

      Parameters:
      nulls - Must be set to Nulls.NULLABLE if the type allows the null value, Nulls.NO_NULL if not.
      length - The length of the string.
      Returns:
      The String column type.
    • beString

      public static final SimpleType<String> beString(Charset charset, ST.Nulls nulls, ST.OutrowStringLength length) throws NullPointerException
      Returns the String column type with an outrow storage scheme and applying the specified charset for any byte conversions. It is safe to cast the returned value to the StringType interface.
      Parameters:
      charset - The Charset to be used to encode a string value, not allowed to be null.
      nulls - Must be set to Nulls.NULLABLE if the type allows the null value, Nulls.NO_NULL if not.
      length - The length of the string.
      Returns:
      The String column type.
      Throws:
      NullPointerException - If charset is null.
    • beString

      public static final SimpleType<String> beString(Charset charset, ST.Nulls nulls, int length) throws NullPointerException, IllegalArgumentException
      Returns the String column type with an inrow storage scheme and applying the specified charset for any byte conversions. It is safe to cast the returned value to the StringType interface.
      Parameters:
      charset - The Charset to be used to encode a string value, not allowed to be null.
      nulls - Must be set to Nulls.NULLABLE if the type allows the null value, Nulls.NO_NULL if not.
      length - The maximum number of characters of the String, must be greater than or equal to 1 and less than or equal to Integer.MAX_VALUE - 4. Depending on the character set the maximum number of characters may be less than this value.
      Returns:
      The String column type.
      Throws:
      NullPointerException - If charset is null.
      IllegalArgumentException - If length is less than 1 or greater than Integer.MAX_VALUE - 4.