Package acdp.design
Class ST
java.lang.Object
acdp.design.ST
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
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enum
Defines the constants used to indicate whether a column allows for thenull
value or not.static enum
Defines the constants used to indicate the maximum number of characters of an outrow string. -
Method Summary
Modifier and TypeMethodDescriptionstatic final SimpleType<Boolean>
Returns the column type analogon of a Javaboolean
orBoolean
type.static final SimpleType<Byte>
Returns the column type analogon of a Javabyte
orByte
type.static final SimpleType<Double>
Returns the column type analogon of a Javadouble
orDouble
type.static final SimpleType<Float>
Returns the column type analogon of a Javafloat
orFloat
type.static final SimpleType<Integer>
Returns column type analogon of a Javaint
orInteger
type.static final SimpleType<Long>
Returns the column type analogon of a Javalong
orLong
type.static final SimpleType<Short>
Returns the column type analogon of a Javashort
orShort
type.static final SimpleType<String>
beString()
Returns the column type analogon of a JavaString
type.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.static final SimpleType<String>
Returns the String column type with an inrow storage scheme and applying the specified charset for any byte conversions.static final SimpleType<String>
beString
(Charset charset, ST.Nulls nulls, ST.OutrowStringLength length) Returns the String column type with an outrow storage scheme and applying the specified charset for any byte conversions.
-
Method Details
-
beBoolean
Returns the column type analogon of a Javaboolean
orBoolean
type. It is safe to cast the returned value to theBooleanType
interface.- Parameters:
nulls
- Must be set toNulls.NULLABLE
if the type allows thenull
value,Nulls.NO_NULL
if not.- Returns:
- The Boolean column type.
-
beByte
Returns the column type analogon of a Javabyte
orByte
type. It is safe to cast the returned value to theByteType
interface.- Parameters:
nulls
- Must be set toNulls.NULLABLE
if the type allows thenull
value,Nulls.NO_NULL
if not.- Returns:
- The Byte column type.
-
beShort
Returns the column type analogon of a Javashort
orShort
type. It is safe to cast the returned value to theShortType
interface.- Parameters:
nulls
- Must be set toNulls.NULLABLE
if the type allows thenull
value,Nulls.NO_NULL
if not.- Returns:
- The Short column type.
-
beInteger
Returns column type analogon of a Javaint
orInteger
type. It is safe to cast the returned value to theIntegerType
interface.- Parameters:
nulls
- Must be set toNulls.NULLABLE
if the type allows thenull
value,Nulls.NO_NULL
if not.- Returns:
- The Integer column type.
-
beLong
Returns the column type analogon of a Javalong
orLong
type. It is safe to cast the returned value to theLongType
interface.- Parameters:
nulls
- Must be set toNulls.NULLABLE
if the type allows thenull
value,Nulls.NO_NULL
if not.- Returns:
- The Long column type.
-
beFloat
Returns the column type analogon of a Javafloat
orFloat
type. It is safe to cast the returned value to theFloatType
interface.- Parameters:
nulls
- Must be set toNulls.NULLABLE
if the type allows thenull
value,Nulls.NO_NULL
if not.- Returns:
- The Float column type.
-
beDouble
Returns the column type analogon of a Javadouble
orDouble
type. It is safe to cast the returned value to theDoubleType
interface.- Parameters:
nulls
- Must be set toNulls.NULLABLE
if the type allows thenull
value,Nulls.NO_NULL
if not.- Returns:
- The Double column type.
-
beString
Returns the column type analogon of a JavaString
type. It is safe to cast the returned value to theStringType
interface.Invoking this method has the same effect as invoking
beString(Nulls.NULLABLE, OutrowStringLength.GIANT)
.- Returns:
- The String column type.
-
beString
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 theStringType
interface.Invoking this method has the same effect as invoking
beString(StandardCharsets.UTF_8, nulls, length)
.- Parameters:
nulls
- Must be set toNulls.NULLABLE
if the type allows thenull
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 theStringType
interface.- Parameters:
charset
- TheCharset
to be used to encode a string value, not allowed to benull
.nulls
- Must be set toNulls.NULLABLE
if the type allows thenull
value,Nulls.NO_NULL
if not.length
- The length of the string.- Returns:
- The String column type.
- Throws:
NullPointerException
- Ifcharset
isnull
.
-
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 theStringType
interface.- Parameters:
charset
- TheCharset
to be used to encode a string value, not allowed to benull
.nulls
- Must be set toNulls.NULLABLE
if the type allows thenull
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 toInteger.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
- Ifcharset
isnull
.IllegalArgumentException
- Iflength
is less than 1 or greater thanInteger.MAX_VALUE
- 4.
-