Enum Class TypeConvention
- All Implemented Interfaces:
Serializable
,Comparable<TypeConvention>
,Constable
Common conventions for types
.- Since:
- 1.0
- Author:
- Graeme Rocher
-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>>
-
Enum Constant Summary
-
Method Summary
Modifier and TypeMethodDescriptionasHyphenatedName
(Class type) Returns the hyphenated equivalent for this convention for the given class.asPropertyName
(Class type) Returns the property name equivalent for this convention for the given class.static TypeConvention
Returns the enum constant of this class with the specified name.static TypeConvention[]
values()
Returns an array containing the constants of this enum class, in the order they are declared.
-
Enum Constant Details
-
CONTROLLER
-
SERVICE
-
REPOSITORY
-
JOB
-
FACTORY
-
-
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
-
asPropertyName
Returns the property name equivalent for this convention for the given class. Eg. BookController -> book
- Parameters:
type
- The type- Returns:
- The property name equivalent
-
asHyphenatedName
Returns the hyphenated equivalent for this convention for the given class. Eg. BookShopController -> book-shop
- Parameters:
type
- The type- Returns:
- The property name equivalent
-