Class StringSetConverter

java.lang.Object
com.github.joschi.jadconfig.converters.StringSetConverter
All Implemented Interfaces:
Converter<Set<String>>
Direct Known Subclasses:
TrimmedStringSetConverter

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

    • StringSetConverter

      public StringSetConverter()
  • Method Details

    • convertFrom

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

      The value is being split on comma.

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

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

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

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