@GwtCompatible public enum CaseFormat extends Enum<CaseFormat >
Enum Constant and Description |
---|
LOWER_CAMEL
Java variable naming convention, e.g., "lowerCamel".
|
LOWER_HYPHEN
Hyphenated variable naming convention, e.g., "lower-hyphen".
|
LOWER_UNDERSCORE
C++ variable naming convention, e.g., "lower_underscore".
|
UPPER_CAMEL
Java and C++ class naming convention, e.g., "UpperCamel".
|
UPPER_UNDERSCORE
Java and C++ constant naming convention, e.g., "UPPER_UNDERSCORE".
|
Modifier and Type | Method and Description |
---|---|
Converter |
converterTo(CaseFormat
Returns a
Converter that converts strings from this format to
targetFormat .
|
String |
to(CaseFormat
Converts the specified
String str from this format to the specified
format .
|
static CaseFormat |
valueOf(String
Returns 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.
|
public static final CaseFormatLOWER_HYPHEN
public static final CaseFormatLOWER_UNDERSCORE
public static final CaseFormatLOWER_CAMEL
public static final CaseFormatUPPER_CAMEL
public static final CaseFormatUPPER_UNDERSCORE
public static CaseFormat[] values()
for (CaseFormat c : CaseFormat.values()) System.out.println(c);
public static CaseFormatvalueOf(String name)
name
- the name of the enum constant to be returned.
IllegalArgumentException
- if this enum type has no constant with the specified name
NullPointerException
- if the argument is null
public final Stringto(CaseFormat format, String str)
String str
from this format to the specified
format
. A "best effort" approach is taken; if
str
does not conform to the assumed format, then the behavior of this method is undefined but we make a reasonable effort at converting anyway.
@Beta public Converter<String ,String > converterTo(CaseFormat targetFormat)
Converter
that converts strings from this format to
targetFormat
.