test_class.declarator: serviceClassParser
test_class.modifier: private
test_class.original_string: private ServiceClassParser serviceClassParser;
test_class.type: ServiceClassParser
test_class.var_name: serviceClassParser
test_class.declarator: settings
test_class.modifier: private
test_class.original_string: private TypescriptServiceGeneratorConfiguration settings;
test_class.type: TypescriptServiceGeneratorConfiguration
test_class.var_name: settings
test_class.file: typescript-service-generator-core/src/test/java/com/palantir/code/ts/generator/ServiceClassParserTest.java
test_class.identifier: ServiceClassParserTest
test_case.body: @Test
      public void plainTextTest() {
          ServiceModel model = serviceClassParser.parseServiceClass(PlainTextService.class, settings);
  
          ImmutableServiceEndpointParameterModel expectedParameterModel = ImmutableServiceEndpointParameterModel.builder()
                                                                                                                .javaType(String.class)
                                                                                                                .tsType(TsType.String)
                                                                                                                .build();
  
          ImmutableServiceEndpointModel expectedEndpointModel = ImmutableServiceEndpointModel.builder()
                                                                                             .javaReturnType(String.class)
                                                                                             .tsReturnType(TsType.String)
                                                                                             .addParameters(expectedParameterModel)
                                                                                             .endpointName("plainText")
                                                                                             .endpointPath("plainText")
                                                                                             .endpointMethodType("GET")
                                                                                             .endpointRequestMediaType(MediaType.TEXT_PLAIN)
                                                                                             .endpointResponseMediaType(MediaType.TEXT_PLAIN)
                                                                                             .build();
          InnerServiceModel innerServiceModel = ImmutableInnerServiceModel.builder()
                                                                          .addEndpointModels(expectedEndpointModel)
                                                                          .servicePath("plainTextService")
                                                                          .name("PlainTextService")
                                                                          .build();
  
          ServiceModel expectedServiceModel = ImmutableServiceModel.builder()
                                                           .addInnerServiceModels(innerServiceModel)
                                                           .name("PlainTextService")
                                                           .addReferencedTypes(String.class)
                                                           .build();
  
          assertEquals(expectedServiceModel, model);
      }
test_case.class_method_signature: ServiceClassParserTest.plainTextTest()
test_case.full_signature: @Test public void plainTextTest()
test_case.identifier: plainTextTest
test_case.invocations: parseServiceClass build tsType javaType builder build endpointResponseMediaType endpointRequestMediaType endpointMethodType endpointPath endpointName addParameters tsReturnType javaReturnType builder build name servicePath addEndpointModels builder build addReferencedTypes name addInnerServiceModels builder assertEquals
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void plainTextTest()
focal_class.declarator: ANNOTATION_CLASSES = Lists.newArrayList(POST.class, GET.class, DELETE.class, PUT.class, OPTIONS.class)
focal_class.modifier: @SuppressWarnings("unchecked")
      private final static
focal_class.original_string: @SuppressWarnings("unchecked")
      private final static List<Class<? extends Annotation>> ANNOTATION_CLASSES = Lists.newArrayList(POST.class, GET.class, DELETE.class, PUT.class, OPTIONS.class);
focal_class.type: List<Class<? extends Annotation>>
focal_class.var_name: ANNOTATION_CLASSES
focal_class.file: typescript-service-generator-core/src/main/java/com/palantir/code/ts/generator/ServiceClassParser.java
focal_class.identifier: ServiceClassParser
focal_class.class_method_signature: ServiceClassParser.getAllServiceMethods(Class<?> serviceClass, MethodFilter methodFilter)
focal_class.full_signature: public Set<Method> getAllServiceMethods(Class<?> serviceClass, MethodFilter methodFilter)
focal_class.identifier: getAllServiceMethods
focal_class.modifiers: public
focal_class.parameters: (Class<?> serviceClass, MethodFilter methodFilter)
focal_class.return: Set<Method>
focal_class.signature: Set<Method> getAllServiceMethods(Class<?> serviceClass, MethodFilter methodFilter)
focal_class.class_method_signature: ServiceClassParser.parseServiceClass(Class<?> mainServiceClass, TypescriptServiceGeneratorConfiguration settings, Class<?>... serviceClassesToMerge)
focal_class.full_signature: public ServiceModel parseServiceClass(Class<?> mainServiceClass, TypescriptServiceGeneratorConfiguration settings, Class<?>... serviceClassesToMerge)
focal_class.identifier: parseServiceClass
focal_class.modifiers: public
focal_class.parameters: (Class<?> mainServiceClass, TypescriptServiceGeneratorConfiguration settings, Class<?>... serviceClassesToMerge)
focal_class.return: ServiceModel
focal_class.signature: ServiceModel parseServiceClass(Class<?> mainServiceClass, TypescriptServiceGeneratorConfiguration settings, Class<?>... serviceClassesToMerge)
focal_class.class_method_signature: ServiceClassParser.computeEndpointModels(Set<Method> endpoints, ModelCompiler compiler, TypescriptServiceGeneratorConfiguration settings)
focal_class.full_signature: private static List<ServiceEndpointModel> computeEndpointModels(Set<Method> endpoints, ModelCompiler compiler, TypescriptServiceGeneratorConfiguration settings)
focal_class.identifier: computeEndpointModels
focal_class.modifiers: private static
focal_class.parameters: (Set<Method> endpoints, ModelCompiler compiler, TypescriptServiceGeneratorConfiguration settings)
focal_class.return: List<ServiceEndpointModel>
focal_class.signature: List<ServiceEndpointModel> computeEndpointModels(Set<Method> endpoints, ModelCompiler compiler, TypescriptServiceGeneratorConfiguration settings)
focal_class.class_method_signature: ServiceClassParser.getMethodType(Method endpoint)
focal_class.full_signature: private static String getMethodType(Method endpoint)
focal_class.identifier: getMethodType
focal_class.modifiers: private static
focal_class.parameters: (Method endpoint)
focal_class.return: String
focal_class.signature: String getMethodType(Method endpoint)
focal_class.class_method_signature: ServiceClassParser.getParamterAnnotationMaps(Method endpoint)
focal_class.full_signature: private static List<Map<Class<?>, Annotation>> getParamterAnnotationMaps(Method endpoint)
focal_class.identifier: getParamterAnnotationMaps
focal_class.modifiers: private static
focal_class.parameters: (Method endpoint)
focal_class.return: List<Map<Class<?>, Annotation>>
focal_class.signature: List<Map<Class<?>, Annotation>> getParamterAnnotationMaps(Method endpoint)
focal_class.class_method_signature: ServiceClassParser.getTypesFromEndpoint(Method endpoint, TypescriptServiceGeneratorConfiguration settings)
focal_class.full_signature: private static Set<Type> getTypesFromEndpoint(Method endpoint, TypescriptServiceGeneratorConfiguration settings)
focal_class.identifier: getTypesFromEndpoint
focal_class.modifiers: private static
focal_class.parameters: (Method endpoint, TypescriptServiceGeneratorConfiguration settings)
focal_class.return: Set<Type>
focal_class.signature: Set<Type> getTypesFromEndpoint(Method endpoint, TypescriptServiceGeneratorConfiguration settings)
focal_method.body: public ServiceModel parseServiceClass(Class<?> mainServiceClass, TypescriptServiceGeneratorConfiguration settings, Class<?>... serviceClassesToMerge) {
          List<Class<?>> serviceClazzes = Lists.newArrayList(mainServiceClass);
          serviceClazzes.addAll(Lists.newArrayList(serviceClassesToMerge));
          ImmutableServiceModel.Builder serviceModel = ImmutableServiceModel.builder();
          serviceModel.name(mainServiceClass.getSimpleName());
          for (Class<?> serviceClass : serviceClazzes) {
              ImmutableInnerServiceModel.Builder innerServiceModel = ImmutableInnerServiceModel.builder();
              Path servicePathAnnotation = serviceClass.getAnnotation(Path.class);
              innerServiceModel.servicePath(servicePathAnnotation == null ? "" : PathUtils.trimSlashes(servicePathAnnotation.value()));
              innerServiceModel.name(serviceClass.getSimpleName());
  
              Set<Method> serviceMethods = getAllServiceMethods(serviceClass, settings.methodFilter());
              // find and stores all types that are referenced by this service
              Set<Type> referencedTypes = Sets.newHashSet();
              for (Method method : serviceMethods) {
                  referencedTypes.addAll(getTypesFromEndpoint(method, settings));
              }
              serviceModel.addAllReferencedTypes(referencedTypes);
  
              ModelCompiler compiler = new TypeScriptGenerator(settings.getSettings()).getModelCompiler();
  
              List<ServiceEndpointModel> endpointModels = Lists.newArrayList();
              endpointModels = computeEndpointModels(serviceMethods, compiler, settings);
  
              Collections.sort(endpointModels);
              innerServiceModel.endpointModels(endpointModels);
              serviceModel.addInnerServiceModels(innerServiceModel.build());
          }
          return serviceModel.build();
      }
focal_method.class_method_signature: ServiceClassParser.parseServiceClass(Class<?> mainServiceClass, TypescriptServiceGeneratorConfiguration settings, Class<?>... serviceClassesToMerge)
focal_method.full_signature: public ServiceModel parseServiceClass(Class<?> mainServiceClass, TypescriptServiceGeneratorConfiguration settings, Class<?>... serviceClassesToMerge)
focal_method.identifier: parseServiceClass
focal_method.invocations: newArrayList addAll newArrayList builder name getSimpleName builder getAnnotation servicePath trimSlashes value name getSimpleName getAllServiceMethods methodFilter newHashSet addAll getTypesFromEndpoint addAllReferencedTypes getModelCompiler getSettings newArrayList computeEndpointModels sort endpointModels addInnerServiceModels build build
focal_method.modifiers: public
focal_method.parameters: (Class<?> mainServiceClass, TypescriptServiceGeneratorConfiguration settings, Class<?>... serviceClassesToMerge)
focal_method.return: ServiceModel
focal_method.signature: ServiceModel parseServiceClass(Class<?> mainServiceClass, TypescriptServiceGeneratorConfiguration settings, Class<?>... serviceClassesToMerge)