Package de.espirit.or
Enum Class CaseMode
- All Implemented Interfaces:
Serializable
,Comparable<CaseMode>
,Constable
The different case modes (
UPPER_CASE
, LOWER_CASE
, and MIXED_CASE
) a database may support. Use convertCase(String)
to convert identifiers to the appropriate supported case.Use getComparator()
for comparison - e.g. MIXED_CASE.getComparator("test", "Test") yields 0
.- Since:
- 4.1.11
-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>>
-
Enum Constant Summary
Enum ConstantDescriptionOnly lower case identifiers are supported.Mixed case is supported, but upper and lower case are indistinguishable, e.g.Mixed case identifiers are supported.Only upper case identifiers are supported. -
Method Summary
Modifier and TypeMethodDescription@NotNull String
convertCase
(@NotNull String value) Convert the given identifier to the@NotNull Comparator<String>
UPPER_CASE
.getComparator().compare("products", "PRODUCTS") will yield0
.boolean
true
if identifiers are lower case.
Attention:isUpperCase()
and isLowerCase() may both deliverfalse
.boolean
true
if identifiers are upper case.
Attention: isUpperCase() andisLowerCase()
may both deliverfalse
.static CaseMode
Returns the enum constant of this class with the specified name.static CaseMode[]
values()
Returns an array containing the constants of this enum class, in the order they are declared.
-
Enum Constant Details
-
UPPER_CASE
Only upper case identifiers are supported.- Since:
- 4.1.11
-
LOWER_CASE
Only lower case identifiers are supported.- Since:
- 4.1.11
-
MIXED_CASE
Mixed case identifiers are supported.- Since:
- 4.1.11
-
LOWER_CASE_IGNORED_FOR_COMPARE
Mixed case is supported, but upper and lower case are indistinguishable, e.g. "product" and "PRODUCT" are treated equal.
This is behaviour is known from windows for file and folder names.- Since:
- 4.1.11
-
-
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
-
convertCase
Convert the given identifier to the- Parameters:
value
- the string to convert.- Returns:
- The input string converted to the target format (or the input string itself if names are stored in mixed case).
- Since:
- 4.1.11
-
getComparator
UPPER_CASE
.getComparator().compare("products", "PRODUCTS") will yield0
.- Returns:
- A comparator respecting case mode.
- Since:
- 4.1.11
-
isLowerCase
public boolean isLowerCase()true
if identifiers are lower case.
Attention:isUpperCase()
and isLowerCase() may both deliverfalse
.- Returns:
true
if identifiers are lower case.- Since:
- 4.1.10
- See Also:
-
isUpperCase
public boolean isUpperCase()true
if identifiers are upper case.
Attention: isUpperCase() andisLowerCase()
may both deliverfalse
.- Returns:
true
if identifiers are upper case.- Since:
- 4.1.10
- See Also:
-