@Test public void convertFromEmptyString() throws Exception { final List<Pattern> patterns = new PatternListConverter().convertFrom(""); assertTrue(patterns.isEmpty()); }
@Override public List<Pattern> convertFrom(String value) { if (value == null) { throw new ParameterException("Couldn't convert value \"null\" to a list of regular expressions."); } try { final Iterable<String> regexList = Splitter.on(SEPARATOR) .omitEmptyStrings() .trimResults() .split(value); return StreamSupport.stream(regexList.spliterator(), false) .map(Pattern::compile) .collect(Collectors.toList()); } catch (Exception e) { throw new ParameterException(e.getMessage(), e); } }
PatternListConverter implements Converter<List<Pattern>> { @Override public List<Pattern> convertFrom(String value) { if (value == null) { throw new ParameterException("Couldn't convert value \"null\" to a list of regular expressions."); } try { final Iterable<String> regexList = Splitter.on(SEPARATOR) .omitEmptyStrings() .trimResults() .split(value); return StreamSupport.stream(regexList.spliterator(), false) .map(Pattern::compile) .collect(Collectors.toList()); } catch (Exception e) { throw new ParameterException(e.getMessage(), e); } } }
PatternListConverter implements Converter<List<Pattern>> { @Override public List<Pattern> convertFrom(String value) { if (value == null) { throw new ParameterException("Couldn't convert value \"null\" to a list of regular expressions."); } try { final Iterable<String> regexList = Splitter.on(SEPARATOR) .omitEmptyStrings() .trimResults() .split(value); return StreamSupport.stream(regexList.spliterator(), false) .map(Pattern::compile) .collect(Collectors.toList()); } catch (Exception e) { throw new ParameterException(e.getMessage(), e); } }  }
PatternListConverter implements Converter<List<Pattern>> { @Override public List<Pattern> convertFrom(String value) { if (value == null) { throw new ParameterException("Couldn't convert value \"null\" to a list of regular expressions."); } try { final Iterable<String> regexList = Splitter.on(SEPARATOR) .omitEmptyStrings() .trimResults() .split(value); return StreamSupport.stream(regexList.spliterator(), false) .map(Pattern::compile) .collect(Collectors.toList()); } catch (Exception e) { throw new ParameterException(e.getMessage(), e); } }  @Override List<Pattern> convertFrom(String value); @Override String convertTo(List<Pattern> value); }
PatternListConverter implements Converter<List<Pattern>> { @Override public List<Pattern> convertFrom(String value) { if (value == null) { throw new ParameterException("Couldn't convert value \"null\" to a list of regular expressions."); } try { final Iterable<String> regexList = Splitter.on(SEPARATOR) .omitEmptyStrings() .trimResults() .split(value); return StreamSupport.stream(regexList.spliterator(), false) .map(Pattern::compile) .collect(Collectors.toList()); } catch (Exception e) { throw new ParameterException(e.getMessage(), e); } }  @Override List<Pattern> convertFrom(String value); @Override String convertTo(List<Pattern> value);  }