- java.lang.Object
-
- java.lang.Enum<NamingUtil.Format>
-
- net.morimekta.strings.NamingUtil.Format
-
- All Implemented Interfaces:
Serializable
,Comparable<NamingUtil.Format>
- Enclosing class:
- NamingUtil
public static enum NamingUtil.Format extends Enum<NamingUtil.Format>
Formats to be used with name formatting. Any string following either of these naming schemes, should be possible to consistently convert to any other format.See Wikipedia on Multiple Word Identifiers for details. Note that not all possible such formats are handled by the
NamingUtil.format(List, Format)
method, only the ones specified in this enum.
-
-
Enum Constant Summary
Enum Constants Enum Constant Description CAMEL
The Dromedary, or Arabic camel, famous for being the one-humped camel, means a camel case where the first word is not capitalized.LISP
A namespace format concatenates lower-cased names with '-',NAMESPACE
A namespace format concatenates lower-cased names with '.',PASCAL
Pascal case, also known as Upper Camel Case is the standard java naming scheme for classes, and capitalizes each name, and concatenates them directly.SNAKE
Snake case format concatenates lower-cased names with '_',SNAKE_UPPER
Upper case snake case, also called 'screaming snake' case.
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static NamingUtil.Format
valueOf(String name)
Returns the enum constant of this type with the specified name.static NamingUtil.Format[]
values()
Returns an array containing the constants of this enum type, in the order they are declared.
-
-
-
Enum Constant Detail
-
NAMESPACE
public static final NamingUtil.Format NAMESPACE
A namespace format concatenates lower-cased names with '.',E.g.:
namespace.for.my.string
-
LISP
public static final NamingUtil.Format LISP
A namespace format concatenates lower-cased names with '-',E.g.:
namespace-for-my-string
-
SNAKE
public static final NamingUtil.Format SNAKE
Snake case format concatenates lower-cased names with '_',E.g.
snake_case
.
-
SNAKE_UPPER
public static final NamingUtil.Format SNAKE_UPPER
Upper case snake case, also called 'screaming snake' case.E.g.
SCREAMING_SNAKE_CASE
.
-
PASCAL
public static final NamingUtil.Format PASCAL
Pascal case, also known as Upper Camel Case is the standard java naming scheme for classes, and capitalizes each name, and concatenates them directly.E.g.:
CamelCase
-
CAMEL
public static final NamingUtil.Format CAMEL
The Dromedary, or Arabic camel, famous for being the one-humped camel, means a camel case where the first word is not capitalized. Also called 'lower Camel Case' and in certain circumstances the 'hungarian notation'. See wikipedia for details.E.g.:
dromedaryCase
-
-
Method Detail
-
values
public static NamingUtil.Format[] values()
Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:for (NamingUtil.Format c : NamingUtil.Format.values()) System.out.println(c);
- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
public static NamingUtil.Format valueOf(String name)
Returns 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 nameNullPointerException
- if the argument is null
-
-