Class StringToEnumConverter

  • All Implemented Interfaces:
    Converter<String,​Enum>, Serializable

    @Deprecated
    public class StringToEnumConverter
    extends Object
    implements Converter<String,​Enum>
    Deprecated.
    As of 8.0, a lightweight lambda-based converter can be build with Binder.forField(...).withConverter(...) methods.

    A converter that converts from String to an Enum and back.

    Designed to provide nice human readable strings for Enum classes conforming to one of these patterns:
    • The constants are named SOME_UPPERCASE_WORDS and there's no toString implementation.
    • toString() always returns the same human readable string that is not the same as its name() value. Each constant in the enum type returns a distinct toString() value.
    Will not necessarily work correctly for other cases.
    Since:
    7.4
    Author:
    Vaadin Ltd
    See Also:
    Serialized Form