Enum CaseFormat
- All Implemented Interfaces:
- Serializable,- Comparable<CaseFormat>,- Constable
Utility class for converting between various ASCII case formats. Behavior is undefined for
 non-ASCII input.
- Since:
- 1.0
- Author:
- Mike Bostock
- 
Nested Class SummaryNested classes/interfaces inherited from class java.lang.EnumEnum.EnumDesc<E extends Enum<E>>
- 
Enum Constant SummaryEnum ConstantsEnum ConstantDescriptionJava variable naming convention, e.g., "lowerCamel".Hyphenated variable naming convention, e.g., "lower-hyphen".C++ variable naming convention, e.g., "lower_underscore".Java and C++ class naming convention, e.g., "UpperCamel".Java and C++ constant naming convention, e.g., "UPPER_UNDERSCORE".
- 
Method SummaryModifier and TypeMethodDescriptionconverterTo(CaseFormat targetFormat) Returns a serializableConverterthat converts strings from this format totargetFormat.final Stringto(CaseFormat format, String str) Converts the specifiedString strfrom this format to the specifiedformat.static CaseFormatReturns the enum constant of this type with the specified name.static CaseFormat[]values()Returns an array containing the constants of this enum type, in the order they are declared.
- 
Enum Constant Details- 
LOWER_HYPHENHyphenated variable naming convention, e.g., "lower-hyphen". This format is also colloquially known as "kebab case".
- 
LOWER_UNDERSCOREC++ variable naming convention, e.g., "lower_underscore".
- 
LOWER_CAMELJava variable naming convention, e.g., "lowerCamel".
- 
UPPER_CAMELJava and C++ class naming convention, e.g., "UpperCamel".
- 
UPPER_UNDERSCOREJava and C++ constant naming convention, e.g., "UPPER_UNDERSCORE".
 
- 
- 
Method Details- 
valuesReturns an array containing the constants of this enum type, in the order they are declared.- Returns:
- an array containing the constants of this enum type, in the order they are declared
 
- 
valueOfReturns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (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 type has no constant with the specified name
- NullPointerException- if the argument is null
 
- 
toConverts the specifiedString strfrom this format to the specifiedformat. A "best effort" approach is taken; ifstrdoes not conform to the assumed format, then the behavior of this method is undefined but we make a reasonable effort at converting anyway.
- 
converterToReturns a serializableConverterthat converts strings from this format totargetFormat.- Since:
- 16.0
 
 
-