public class EnumValueEncoder<E extends Enum<E>> extends Object implements ValueEncoder<E>
Constructor and Description |
---|
EnumValueEncoder(TypeCoercer typeCoercer,
Class<E> enumType) |
Modifier and Type | Method and Description |
---|---|
String |
toClient(E value)
Converts a value into a client-side representation.
|
E |
toValue(String clientValue)
Converts a client-side representation, provided by
ValueEncoder.toClient(Object) , back into a server-side value. |
public EnumValueEncoder(TypeCoercer typeCoercer, Class<E> enumType)
public String toClient(E value)
ValueEncoder
ValueEncoder.toValue(String)
. In
some cases, what is returned is an identifier used to locate the true object, rather than a string representation
of the value itself.toClient
in interface ValueEncoder<E extends Enum<E>>
value
- to be encodedpublic E toValue(String clientValue)
ValueEncoder
ValueEncoder.toClient(Object)
, back into a server-side value.toValue
in interface ValueEncoder<E extends Enum<E>>
clientValue
- string representation of the value's identity5.6.3 - Copyright © 2003-2021 The Apache Software Foundation.