Class StringToCollectionConverter

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

    @Deprecated
    public class StringToCollectionConverter
    extends Object
    implements Converter<String,​Collection>
    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 Collection of tokens and back.

    Allows to break a string into tokens using delimiter. Each token can be converted to its own model using provided converter.

    Default constructor uses ", " as delimiter string and String for token types. Other constructors allow to configure delimiter and token types.

    Since:
    7.5.0
    Author:
    Vaadin Ltd
    See Also:
    Serialized Form
    • Constructor Detail

      • StringToCollectionConverter

        public StringToCollectionConverter()
        Deprecated.
        Creates converter with ", " as delimiter and String as token model type in collection.
      • StringToCollectionConverter

        public StringToCollectionConverter​(String delimiter)
        Deprecated.
        Creates converter with given delimiter and String as token model type in collection.
        Parameters:
        delimiter - custom delimiter
      • StringToCollectionConverter

        public StringToCollectionConverter​(Converter<String,​?> tokenConverter,
                                           Class<?> tokenType)
        Deprecated.
        Creates converter with given tokenConverter for convert tokens and expected tokenType.

        If tokenConverter is null then no conversation is done and String is used as token type in resulting model collection.

        Parameters:
        tokenConverter - converter for token
        tokenType - expected token model type
      • StringToCollectionConverter

        public StringToCollectionConverter​(String delimiter,
                                           Converter<String,​?> tokenConverter,
                                           Class<?> tokenClass)
        Deprecated.
        Creates converter with given tokenConverter for convert tokens and expected tokenType.

        If tokenConverter is null then no conversation is done and String is used as token type in resulting model collection.

        Parameters:
        tokenConverter - converter for token
        tokenClass - expected token model type
        delimiter - delimiter in presentation string
      • StringToCollectionConverter

        public StringToCollectionConverter​(String delimiter,
                                           Converter<String,​?> tokenConverter,
                                           Class<?> tokenClass,
                                           StringToCollectionConverter.CollectionFactory factory)
        Deprecated.
        Creates converter with given tokenConverter for convert tokens and expected tokenType.

        If tokenConverter is null then no conversation is done and String is used as token type in resulting model collection.

        Parameters:
        tokenConverter - converter for token
        tokenClass - expected token model type
        delimiter - delimiter in presentation string
        factory - factory to create resulting collection