- All Implemented Interfaces:
Serializable,Comparable<CaseConversion>,Constable
Represents the different character cases and allows
conversion.- Since:
- 1.0.0
-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>> -
Enum Constant Summary
Enum ConstantsEnum ConstantDescriptionConvertto lower case.Do not convert (keep original case).Convertto upper case. -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final charThe character representingORIGINAL_CASEinexamples. -
Method Summary
Modifier and TypeMethodDescriptionabstract voidappend(StringBuilder sb, String text) static booleanareIncompatible(CaseConversion case1, CaseConversion case2) charasExample(char c) charconvert(char c) static booleanisCaseChange(CaseConversion caseConversion) static CaseConversionofExample(char c, boolean strict) static CaseConversionReturns the enum constant of this class with the specified name.static CaseConversion[]values()Returns an array containing the constants of this enum class, in the order they are declared.
-
Enum Constant Details
-
LOWER_CASE
Convertto lower case. -
UPPER_CASE
Convertto upper case. -
ORIGINAL_CASE
Do not convert (keep original case).
-
-
Field Details
-
EXAMPLE_CHAR_FOR_ORIGINAL_CASE
public static final char EXAMPLE_CHAR_FOR_ORIGINAL_CASEThe character representingORIGINAL_CASEinexamples. Was chosen so it can be used in java names (including packages), paths and URIs but is unlikely to conflict with other semantical usage. However, this choice is arbitrarily.- See Also:
-
-
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
-
convert
-
convert
- Parameters:
string- the originalString.locale- the explicitLocaleto use. In most cases you want to useconvert(String)instead.- Returns:
- the converted
String.
-
convert
public char convert(char c) - Parameters:
c- the original character.- Returns:
- the converted character.
-
append
- Parameters:
sb- theStringBuildertoappendto.text- the text to append.
-
asExample
public char asExample(char c) - Parameters:
c- the character toconvert.- Returns:
- the
convertedcharactercbutEXAMPLE_CHAR_FOR_ORIGINAL_CASEif this isORIGINAL_CASE.
-
ofExample
- Parameters:
c- the example character.strict- if the character has to be an upper/lower case letter orEXAMPLE_CHAR_FOR_ORIGINAL_CASE.- Returns:
UPPER_CASEif the given character isupper case,LOWER_CASEif the given character islower case, andORIGINAL_CASEotherwise (might need to be remapped or handled specially).
-
isCaseChange
- Parameters:
caseConversion- theCaseConversionto test. May benull.- Returns:
trueif the givenCaseConversionisLOWER_CASEorUPPER_CASE.
-
areIncompatible
- Parameters:
case1- the firstCaseConversion.case2- the secondCaseConversion.- Returns:
trueif bothCaseConversions are incompatible to each other. This means they are not same and are bothcase changing. Otherwisefalse.
-