Enum Class CaseFormat
- All Implemented Interfaces:
Serializable
,Comparable<CaseFormat>
,Constable
Specifies case format translation. This should accommodate most, if not all languages. This relies on the underlying
Guava library, but adds additional cases.
-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>>
-
Enum Constant Summary
Enum ConstantsEnum ConstantDescriptionSeeCaseFormat.LOWER_CAMEL
SeeCaseFormat.LOWER_HYPHEN
SeeCaseFormat.LOWER_UNDERSCORE
Indicates natural case, which means to use the underlying language's default format.SeeCaseFormat.UPPER_CAMEL
SeeCaseFormat.UPPER_UNDERSCORE
-
Method Summary
Modifier and TypeMethodDescriptionfinal String
to
(CaseFormat other, String in) Converts this to the other case.static CaseFormat
Returns the enum constant of this class with the specified name.static CaseFormat[]
values()
Returns an array containing the constants of this enum class, in the order they are declared.
-
Enum Constant Details
-
NATURAL
Indicates natural case, which means to use the underlying language's default format. When either case involves natural case, no conversion will take effect. -
LOWER_HYPHEN
SeeCaseFormat.LOWER_HYPHEN
-
LOWER_CAMEL
SeeCaseFormat.LOWER_CAMEL
-
UPPER_CAMEL
SeeCaseFormat.UPPER_CAMEL
-
LOWER_UNDERSCORE
SeeCaseFormat.LOWER_UNDERSCORE
-
UPPER_UNDERSCORE
SeeCaseFormat.UPPER_UNDERSCORE
-
-
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
-
to
Converts this to the other case.- Parameters:
other
- the other casein
- the input stream- Returns:
- the input string converted to the requested case.
-