- All Implemented Interfaces:
Serializable,Comparable<TextTypes.StringConversion>,java.lang.constant.Constable
- Enclosing class:
- TextTypes
Enumerates the possible conversions for string-valued text types.
-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>> -
Enum Constant Summary
Enum ConstantsEnum ConstantDescriptionLeading and trailing whitespace is preserved and the empty string is parsed as a null value.Leading and trailing whitespace is removed and the empty string is parsed as a null value.Leading and trailing whitespace is preserved.Leading and trailing whitespace is removed. -
Method Summary
Modifier and TypeMethodDescriptionstatic TextTypes.StringConversiongetConversion(boolean trimWhitespace, boolean nullable) Gets the conversion with the specified properties.booleanIndicates whether the empty string is converted to a null value or preserved as the empty string.booleanIndicates whether the conversion trims leading and trailing whitespace.static TextTypes.StringConversionReturns the enum constant of this class with the specified name.static TextTypes.StringConversion[]values()Returns an array containing the constants of this enum class, in the order they are declared.
-
Enum Constant Details
-
RAW
Leading and trailing whitespace is preserved. -
NULLABLE_RAW
Leading and trailing whitespace is preserved and the empty string is parsed as a null value. -
TRIMMED
Leading and trailing whitespace is removed. -
NULLABLE_TRIMMED
Leading and trailing whitespace is removed and the empty string is parsed as a null value.
-
-
Method Details
-
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
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 nameNullPointerException- if the argument is null
-
isTrimmed
public boolean isTrimmed()Indicates whether the conversion trims leading and trailing whitespace.- Returns:
trueif the conversion will trim whitespace, otherwisefalse.
-
isNullable
public boolean isNullable()Indicates whether the empty string is converted to a null value or preserved as the empty string.- Returns:
trueif the conversion translates the empty string, otherwisefalse.
-
getConversion
Gets the conversion with the specified properties.- Parameters:
trimWhitespace- whether the conversion should trim whitespacenullable- whether the conversion translates the empty string to null- Returns:
- the appropriate conversion
-