T
- the type of enumerationpublic final class StringToEnumCoercion<T extends Enum> extends Object implements Coercion<String,T>
Coercion
for converting strings into an instance of a particular
enumerated type. The name
is used as the key to identify the enum instance, in a case-insensitive
fashion.
Moved from tapestry-core to tapestry-ioc in release 5.3, but kept in same package for compatibility.
Moved tapestry-ioc to commons in release 5.4, but kept in same package for compatibility.Constructor and Description |
---|
StringToEnumCoercion(Class<T> enumClass) |
StringToEnumCoercion(Class<T> enumClass,
T... values) |
Modifier and Type | Method and Description |
---|---|
StringToEnumCoercion<T> |
addAlias(String alias,
T value)
Allows an alias value (alternate) string to reference a value.
|
T |
coerce(String input)
Converts an input value.
|
static <T extends Enum> |
create(Class<T> enumClass) |
public StringToEnumCoercion(Class<T> enumClass)
public StringToEnumCoercion(Class<T> enumClass, T... values)
public T coerce(String input)
Coercion
public StringToEnumCoercion<T> addAlias(String alias, T value)
public static <T extends Enum> StringToEnumCoercion<T> create(Class<T> enumClass)
5.6.3 - Copyright © 2003-2021 The Apache Software Foundation.