Ejemplo n.º 1
0
 public static <T> List<T> createFromList(String raw, TypedOption<T> option) {
   if (raw == null) {
     return Collections.emptyList();
   }
   final String[] segments = raw.split(option.getListSeparator());
   return Arrays.stream(segments).map(s -> create(s.trim(), option)).collect(Collectors.toList());
 }
Ejemplo n.º 2
0
 @Override
 public List<String> getRawValuesForArgument(Argument argument) {
   List<?> list = argumentValues.get(argument);
   if (list != null) {
     return list.stream().map(Object::toString).collect(Collectors.toList());
   }
   return Collections.emptyList();
 }
Ejemplo n.º 3
0
 @Override
 public List<String> getRawValuesForOption(Option option) {
   List<?> list = optionValues.get(option);
   if (list != null) {
     return list.stream().map(Object::toString).collect(Collectors.toList());
   }
   return Collections.emptyList();
 }