private void process(Module module, Service service) { ImmutableServiceDescriptor descriptor = ImmutableServiceDescriptor.builder() .type(NodeType.SERVICE) .name(service.getName()) .canonicalName(service.getCanonicalName()) .description(markdownProcessor.toHtml(service.getComments())) .options(service.getOptions().toMap()) .addAllMethods(service.getMethods().stream() .map(method -> ImmutableServiceMethod.builder() .name(method.getName()) .argTypeId(method.getArgType().getCanonicalName()) .argStream(method.isArgStream()) .returnTypeId(method.getReturnType().getCanonicalName()) .returnStream(method.isReturnStream()) .description(markdownProcessor.toHtml(method.getComments())) .options(method.getOptions().toMap()) .build()) .collect(Collectors.toList())) .build(); String output = "data/type/" + service.getCanonicalName() + ".json"; write(module, output, descriptor); }
private void process(Module module, Service service) { ImmutableServiceDescriptor descriptor = ImmutableServiceDescriptor.builder() .type(NodeType.SERVICE) .name(service.getName()) .canonicalName(service.getCanonicalName()) .description(markdownProcessor.toHtml(service.getComments())) .options(service.getOptions().toMap()) .addAllMethods(service.getMethods().stream() .map(method -> ImmutableServiceMethod.builder() .name(method.getName()) .argTypeId(method.getArgType().getCanonicalName()) .argStream(method.isArgStream()) .returnTypeId(method.getReturnType().getCanonicalName()) .returnStream(method.isReturnStream()) .description(markdownProcessor.toHtml(method.getComments())) .options(method.getOptions().toMap()) .build()) .collect(Collectors.toList())) .build(); String output = "data/type/" + service.getCanonicalName() + ".json"; write(module, output, descriptor); }