Class StringListConverter

java.lang.Object
com.github.joschi.jadconfig.converters.StringListConverter
All Implemented Interfaces:
Converter<List<String>>
Direct Known Subclasses:
TrimmedStringListConverter

public class StringListConverter extends Object implements Converter<List<String>>
Class for converting a comma-separated list to List<String>
Author:
jschalanda
  • Constructor Details

    • StringListConverter

      public StringListConverter()
  • Method Details

    • convertFrom

      public List<String> convertFrom(String value)
      Returns a List of Strings representing the specified String value.

      The value is being split on comma.

      Specified by:
      convertFrom in interface Converter<List<String>>
      Parameters:
      value - The configuration parameter's String value
      Returns:
      A List of Strings representing the configuration parameter's value
    • convertTo

      public String convertTo(List<String> value)
      Returns a String instance representing the configuration parameter's value.

      The elements of the provided List of Strings are concatenated with commas.

      Specified by:
      convertTo in interface Converter<List<String>>
      Parameters:
      value - The configuration parameter's List of String representation
      Returns:
      A String instance representing the configuration parameter's typed value