Пример #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());
 }
Пример #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();
 }
Пример #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();
 }