- java.lang.Object
-
- com.opengamma.strata.collect.named.EnumNames<T>
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description String
format(T value)
Creates a standard Strata mixed case name from an enum-style constant.static <T extends Enum<T> & NamedEnum>
EnumNames<T>of(Class<T> enumType)
Creates an instance deriving the formatted string from the enum constant name.static <T extends Enum<T> & NamedEnum>
EnumNames<T>ofManualToString(Class<T> enumType)
Creates an instance where thetoString
method is written manually.T
parse(String name)
Parses the standard external name for an enum.EnumNames<T>
withParseAlias(String alias, T value)
Returns an instance with an additional alias added.
-
-
-
Method Detail
-
of
public static <T extends Enum<T> & NamedEnum> EnumNames<T> of(Class<T> enumType)
Creates an instance deriving the formatted string from the enum constant name.- Type Parameters:
T
- the type of the enum- Parameters:
enumType
- the type of the enum- Returns:
- the names instance
-
ofManualToString
public static <T extends Enum<T> & NamedEnum> EnumNames<T> ofManualToString(Class<T> enumType)
Creates an instance where thetoString
method is written manually.The
toString
method is called to extract the correct formatted string.- Type Parameters:
T
- the type of the enum- Parameters:
enumType
- the type of the enum- Returns:
- the names instance
-
withParseAlias
public EnumNames<T> withParseAlias(String alias, T value)
Returns an instance with an additional alias added.- Parameters:
alias
- the string of the aliasvalue
- the enum value that the alias represents- Returns:
- the converted name
-
format
public String format(T value)
Creates a standard Strata mixed case name from an enum-style constant.- Parameters:
value
- the enum value to convert- Returns:
- the converted name
-
-