Class EnumValueEncoder<E extends <E>>

  • All Implemented Interfaces:
    ValueEncoder<E>

    public class <E>>
    extends 
    implements ValueEncoder<E>
    A value encoder that can be used for arbitrary Enum types. The enum name is stored as the client side value.
    • Method Detail

      • toClient

        public  toClient​(E value)
        Description copied from interface: ValueEncoder
        Converts a value into a client-side representation. The value should be parseable by 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.
        Specified by:
        <E>>
        Parameters:
        value - to be encoded
        Returns:
        a string representation of the value, or the value's identity
      • toValue

        public  clientValue)
        Description copied from interface: ValueEncoder
        Converts a client-side representation, provided by ValueEncoder.toClient(Object), back into a server-side value.
        Specified by:
        <E>>
        Parameters:
        clientValue - string representation of the value's identity
        Returns:
        the corresponding entity, or null if not found