конвертировать индекс на основе цикла в Java 8

Добавьте + guides(colour = guide_legend(override.aes = list(size=10))) в график. Вы можете играть с аргументом size.

1
задан 21 February 2019 в 07:05
поделиться

1 ответ

Вам придется открыть InsStream для итерации по индексу args, затем создать SimpleEntry каждого arg с соответствующим annotaton (согласно вашему коду), затем вы можете применить свою бизнес-логику.

IntStream.range(0, args.length)
        .mapToObj(argIndex -> new AbstractMap.SimpleEntry<>(args[argIndex], parameterAnnotations[argIndex]))
        .flatMap(objectSimpleEntry -> Arrays.stream(objectSimpleEntry.getValue()).map(annotation -> new AbstractMap.SimpleEntry<>(objectSimpleEntry.getKey(), annotation)))
        .forEach(objectAnnotationSimpleEntry -> {
          Annotation annotation = objectAnnotationSimpleEntry.getValue();
          Object arg = objectAnnotationSimpleEntry.getKey();
          if ((annotation instanceof RequestParam) || (annotation instanceof PathVariable) || (annotation instanceof RequestHeader)) {
            methodArgs.append(arg + "|");
          } else if ((annotation instanceof RequestBody)) {
            methodArgs.append(arg + "|");
          }
        });
0
ответ дан Pankaj Singhal 21 February 2019 в 07:05
поделиться
Другие вопросы по тегам:

Похожие вопросы: