|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | ENUM CONSTANTS | FIELD | METHOD | DETAIL: ENUM CONSTANTS | FIELD | METHOD |
java.lang.Object java.lang.Enum<CaseFormat> com.google.common.base.CaseFormat
@GwtCompatible public enum CaseFormat
Utility class for converting between various ASCII case formats.
Enum Constant Summary | |
---|---|
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". |
Method Summary | |
---|---|
String |
to(CaseFormat format,
String s)
Converts the specified String s from this format to the specified format . |
static CaseFormat |
valueOf(String name)
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. |
Methods inherited from class java.lang.Enum |
---|
clone, compareTo, equals, finalize, getDeclaringClass, hashCode, name, ordinal, toString, valueOf |
Methods inherited from class java.lang.Object |
---|
getClass, notify, notifyAll, wait, wait, wait |
Enum Constant Detail |
---|
public static final CaseFormat LOWER_HYPHEN
public static final CaseFormat LOWER_UNDERSCORE
public static final CaseFormat LOWER_CAMEL
public static final CaseFormat UPPER_CAMEL
public static final CaseFormat UPPER_UNDERSCORE
Method Detail |
---|
public static CaseFormat[] values()
for (CaseFormat c : CaseFormat.values()) System.out.println(c);
public static CaseFormat valueOf(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 nullpublic String to(CaseFormat format, String s)
String s
from this format to the specified format
. A
"best effort" approach is taken; if s
does not conform to the assumed format, then the
behavior of this method is undefined but we make a reasonable effort at converting anyway.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | ENUM CONSTANTS | FIELD | METHOD | DETAIL: ENUM CONSTANTS | FIELD | METHOD |