Search in sources :

Example 1 with Type

use of com.palantir.conjure.spec.Type in project conjure-java by palantir.

the class UndertowServiceHandlerGenerator method generateEndpointHandler.

private TypeSpec generateEndpointHandler(EndpointDefinition endpointDefinition, ServiceDefinition serviceDefinition, ClassName serviceClass, Map<com.palantir.conjure.spec.TypeName, TypeDefinition> typeDefinitions, TypeMapper typeMapper, TypeMapper returnTypeMapper) {
    MethodSpec.Builder handleMethodBuilder = MethodSpec.methodBuilder("handleRequest").addAnnotation(Override.class).addModifiers(Modifier.PUBLIC).addParameter(HttpServerExchange.class, EXCHANGE_VAR_NAME).addException(IOException.class).addCode(endpointInvocation(endpointDefinition, typeDefinitions, typeMapper, returnTypeMapper));
    endpointDefinition.getDeprecated().ifPresent(deprecatedDocsValue -> handleMethodBuilder.addAnnotation(AnnotationSpec.builder(SuppressWarnings.class).addMember("value", "$S", "deprecation").build()));
    MethodSpec.Builder ctorBuilder = MethodSpec.constructorBuilder().addParameter(UndertowRuntime.class, RUNTIME_VAR_NAME).addParameter(serviceClass, DELEGATE_VAR_NAME).addStatement("this.$1N = $1N", RUNTIME_VAR_NAME).addStatement("this.$1N = $1N", DELEGATE_VAR_NAME);
    TypeSpec.Builder endpointBuilder = TypeSpec.classBuilder(endpointToHandlerClassName(endpointDefinition.getEndpointName())).addModifiers(Modifier.PRIVATE, Modifier.STATIC, Modifier.FINAL).addSuperinterface(HttpHandler.class).addSuperinterface(Endpoint.class).addField(FieldSpec.builder(UndertowRuntime.class, RUNTIME_VAR_NAME, Modifier.PRIVATE, Modifier.FINAL).build()).addField(FieldSpec.builder(serviceClass, DELEGATE_VAR_NAME, Modifier.PRIVATE, Modifier.FINAL).build());
    addTags(endpointDefinition, endpointBuilder);
    getBodyParamTypeArgument(endpointDefinition.getArgs()).map(ArgumentDefinition::getType).flatMap(type -> {
        Type dealiased = TypeFunctions.toConjureTypeWithoutAliases(type, typeDefinitions);
        return TypeFunctions.isBinaryOrOptionalBinary(dealiased) ? Optional.empty() : Optional.of(type);
    }).map(typeMapper::getClassName).map(TypeName::box).map(this::immutableCollection).ifPresent(typeName -> {
        TypeName type = ParameterizedTypeName.get(ClassName.get(Deserializer.class), typeName);
        endpointBuilder.addField(FieldSpec.builder(type, DESERIALIZER_VAR_NAME, Modifier.PRIVATE, Modifier.FINAL).build());
        ctorBuilder.addStatement("this.$1N = $2N.bodySerDe().deserializer(new $3T() {}, this)", DESERIALIZER_VAR_NAME, RUNTIME_VAR_NAME, ParameterizedTypeName.get(ClassName.get(TypeMarker.class), typeName));
    });
    endpointDefinition.getReturns().ifPresent(returnType -> {
        Type dealiased = TypeFunctions.toConjureTypeWithoutAliases(returnType, typeDefinitions);
        if (!TypeFunctions.isBinaryOrOptionalBinary(dealiased)) {
            TypeName typeName = returnTypeMapper.getClassName(returnType).box();
            TypeName type = ParameterizedTypeName.get(ClassName.get(Serializer.class), typeName);
            endpointBuilder.addField(FieldSpec.builder(type, SERIALIZER_VAR_NAME, Modifier.PRIVATE, Modifier.FINAL).build());
            ctorBuilder.addStatement("this.$1N = $2N.bodySerDe().serializer(new $3T() {}, this)", SERIALIZER_VAR_NAME, RUNTIME_VAR_NAME, ParameterizedTypeName.get(ClassName.get(TypeMarker.class), typeName));
        }
    });
    endpointBuilder.addMethod(ctorBuilder.build()).addMethod(handleMethodBuilder.build());
    if (UndertowTypeFunctions.isAsync(endpointDefinition, options)) {
        ParameterizedTypeName type = UndertowTypeFunctions.getAsyncReturnType(endpointDefinition, returnTypeMapper, options);
        TypeName resultType = Iterables.getOnlyElement(type.typeArguments);
        endpointBuilder.addSuperinterface(ParameterizedTypeName.get(ClassName.get(ReturnValueWriter.class), resultType));
        endpointBuilder.addMethod(MethodSpec.methodBuilder("write").addModifiers(Modifier.PUBLIC).addAnnotation(Override.class).addParameter(resultType, RESULT_VAR_NAME).addParameter(HttpServerExchange.class, EXCHANGE_VAR_NAME).addException(IOException.class).addCode(generateReturnValueCodeBlock(endpointDefinition, typeDefinitions)).build());
    }
    endpointBuilder.addMethod(MethodSpec.methodBuilder("method").addModifiers(Modifier.PUBLIC).addAnnotation(Override.class).returns(HttpString.class).addStatement("return $1T.$2N", Methods.class, endpointDefinition.getHttpMethod().toString()).build()).addMethod(MethodSpec.methodBuilder("template").addModifiers(Modifier.PUBLIC).addAnnotation(Override.class).returns(String.class).addStatement("return $1S", endpointDefinition.getHttpPath()).build()).addMethod(MethodSpec.methodBuilder("serviceName").addModifiers(Modifier.PUBLIC).addAnnotation(Override.class).returns(String.class).addStatement("return $1S", serviceDefinition.getServiceName().getName()).build()).addMethod(MethodSpec.methodBuilder("name").addModifiers(Modifier.PUBLIC).addAnnotation(Override.class).returns(String.class).addStatement("return $1S", endpointDefinition.getEndpointName().get()).build()).addMethod(MethodSpec.methodBuilder("handler").addModifiers(Modifier.PUBLIC).addAnnotation(Override.class).returns(HttpHandler.class).addStatement("return this").build());
    endpointDefinition.getDeprecated().ifPresent(documentation -> endpointBuilder.addMethod(MethodSpec.methodBuilder("deprecated").addModifiers(Modifier.PUBLIC).addAnnotation(Override.class).returns(ParameterizedTypeName.get(ClassName.get(Optional.class), ClassName.get(String.class))).addStatement("return $1T.of($2S)", Optional.class, documentation).build()));
    return endpointBuilder.build();
}
Also used : HttpHandler(io.undertow.server.HttpHandler) TypeName(com.squareup.javapoet.TypeName) ParameterizedTypeName(com.squareup.javapoet.ParameterizedTypeName) Optional(java.util.Optional) MethodSpec(com.squareup.javapoet.MethodSpec) IOException(java.io.IOException) HttpString(io.undertow.util.HttpString) HeaderAuthType(com.palantir.conjure.spec.HeaderAuthType) OptionalType(com.palantir.conjure.spec.OptionalType) AuthType(com.palantir.conjure.spec.AuthType) ParameterType(com.palantir.conjure.spec.ParameterType) PrimitiveType(com.palantir.conjure.spec.PrimitiveType) ListType(com.palantir.conjure.spec.ListType) Type(com.palantir.conjure.spec.Type) SetType(com.palantir.conjure.spec.SetType) CookieAuthType(com.palantir.conjure.spec.CookieAuthType) Deserializer(com.palantir.conjure.java.undertow.lib.Deserializer) UndertowRuntime(com.palantir.conjure.java.undertow.lib.UndertowRuntime) TypeSpec(com.squareup.javapoet.TypeSpec) Serializer(com.palantir.conjure.java.undertow.lib.Serializer) ParameterizedTypeName(com.squareup.javapoet.ParameterizedTypeName) HttpString(io.undertow.util.HttpString)

Example 2 with Type

use of com.palantir.conjure.spec.Type in project conjure-java by palantir.

the class UndertowServiceHandlerGenerator method generateReturnValueCodeBlock.

private CodeBlock generateReturnValueCodeBlock(EndpointDefinition endpointDefinition, Map<com.palantir.conjure.spec.TypeName, TypeDefinition> typeDefinitions) {
    CodeBlock.Builder code = CodeBlock.builder();
    if (endpointDefinition.getReturns().isPresent()) {
        Type returnType = endpointDefinition.getReturns().get();
        // optional<> handling
        Type dealiased = TypeFunctions.toConjureTypeWithoutAliases(returnType, typeDefinitions);
        if (dealiased.accept(TypeVisitor.IS_OPTIONAL)) {
            CodeBlock serializer;
            if (TypeFunctions.isBinaryOrOptionalBinary(dealiased)) {
                serializer = CodeBlock.builder().add(dealiased.accept(TypeVisitor.IS_BINARY) ? "$1N.bodySerDe().serialize($2N, $3N)" : "$1N.bodySerDe().serialize($2N.get(), $3N)", RUNTIME_VAR_NAME, RESULT_VAR_NAME, EXCHANGE_VAR_NAME).build();
            } else {
                serializer = CodeBlock.builder().add("$1N.serialize($2N, $3N)", SERIALIZER_VAR_NAME, RESULT_VAR_NAME, EXCHANGE_VAR_NAME).build();
            }
            // For optional<>: set response code to 204/NO_CONTENT if result is absent
            code.add(CodeBlock.builder().beginControlFlow("if ($1L)", createIsOptionalPresentCall(TypeFunctions.isBinaryOrOptionalBinary(dealiased) ? dealiased : returnType, RESULT_VAR_NAME, typeDefinitions)).addStatement(serializer).nextControlFlow("else").addStatement("$1N.setStatusCode($2T.NO_CONTENT)", EXCHANGE_VAR_NAME, StatusCodes.class).endControlFlow().build());
        } else {
            if (dealiased.accept(TypeVisitor.IS_BINARY)) {
                code.addStatement("$1N.bodySerDe().serialize($2N, $3N)", RUNTIME_VAR_NAME, RESULT_VAR_NAME, EXCHANGE_VAR_NAME);
            } else {
                code.addStatement("$1N.serialize($2N, $3N)", SERIALIZER_VAR_NAME, RESULT_VAR_NAME, EXCHANGE_VAR_NAME);
            }
        }
    } else {
        // Set 204 response code for void methods
        // Use the constant from undertow for improved source readability, javac will compile it out.
        code.addStatement("$1N.setStatusCode($2T.NO_CONTENT)", EXCHANGE_VAR_NAME, StatusCodes.class);
    }
    return code.build();
}
Also used : HeaderAuthType(com.palantir.conjure.spec.HeaderAuthType) OptionalType(com.palantir.conjure.spec.OptionalType) AuthType(com.palantir.conjure.spec.AuthType) ParameterType(com.palantir.conjure.spec.ParameterType) PrimitiveType(com.palantir.conjure.spec.PrimitiveType) ListType(com.palantir.conjure.spec.ListType) Type(com.palantir.conjure.spec.Type) SetType(com.palantir.conjure.spec.SetType) CookieAuthType(com.palantir.conjure.spec.CookieAuthType) CodeBlock(com.squareup.javapoet.CodeBlock) StatusCodes(io.undertow.util.StatusCodes)

Example 3 with Type

use of com.palantir.conjure.spec.Type in project conjure-java by palantir.

the class DefaultStaticFactoryMethodGenerator method clientImpl.

private MethodSpec clientImpl(EndpointDefinition def) {
    List<ParameterSpec> params = parameterTypes.implementationMethodParams(def);
    MethodSpec.Builder methodBuilder = MethodSpec.methodBuilder(def.getEndpointName().get()).addModifiers(Modifier.PUBLIC).addParameters(params).addAnnotation(Override.class);
    if (def.getDeprecated().isPresent()) {
        methodBuilder.addAnnotation(AnnotationSpec.builder(SuppressWarnings.class).addMember("value", "$S", "deprecation").build());
    }
    TypeName returnType = methodType.switchBy(returnTypes.baseType(def.getReturns()), returnTypes.async(def.getReturns()));
    methodBuilder.returns(returnType);
    CodeBlock.Builder requestParams = CodeBlock.builder();
    def.getAuth().map(DefaultStaticFactoryMethodGenerator::generateAuthHeader).ifPresent(requestParams::add);
    def.getArgs().stream().map(param -> generateParam(def.getEndpointName().get(), param)).forEach(requestParams::add);
    CodeBlock request = CodeBlock.builder().add("$T $L = $T.builder();", Request.Builder.class, REQUEST, Request.class).add(requestParams.build()).build();
    String codeBlock = methodType.switchBy("$L.clients().callBlocking($L, $L.build(), $L);", "$L.clients().call($L, $L.build" + "(), $L);");
    CodeBlock execute = CodeBlock.of(codeBlock, StaticFactoryMethodGenerator.RUNTIME, Names.endpointChannel(def), REQUEST, def.getReturns().filter(type -> isBinaryOrOptionalBinary(returnTypes.baseType(type), returnTypes)).map(type -> StaticFactoryMethodGenerator.RUNTIME + (isOptionalBinary(returnTypes.baseType(type), returnTypes) ? ".bodySerDe().optionalInputStreamDeserializer()" : ".bodySerDe().inputStreamDeserializer()")).orElseGet(() -> def.getEndpointName().get() + "Deserializer"));
    methodBuilder.addCode(request);
    methodBuilder.addCode(methodType.switchBy(def.getReturns().isPresent() ? "return " : "", "return "));
    methodBuilder.addCode(execute);
    return methodBuilder.build();
}
Also used : HeaderAuthType(com.palantir.conjure.spec.HeaderAuthType) TypeVisitor(com.palantir.conjure.visitor.TypeVisitor) Modifier(javax.lang.model.element.Modifier) SafeIllegalStateException(com.palantir.logsafe.exceptions.SafeIllegalStateException) ClassName(com.squareup.javapoet.ClassName) ServiceDefinition(com.palantir.conjure.spec.ServiceDefinition) Options(com.palantir.conjure.java.Options) ParameterTypeVisitor(com.palantir.conjure.visitor.ParameterTypeVisitor) MapType(com.palantir.conjure.spec.MapType) OptionalType(com.palantir.conjure.spec.OptionalType) ParameterSpec(com.squareup.javapoet.ParameterSpec) ImmutableMap(com.google.common.collect.ImmutableMap) AuthType(com.palantir.conjure.spec.AuthType) Deserializer(com.palantir.dialogue.Deserializer) BodyParameterType(com.palantir.conjure.spec.BodyParameterType) ParameterType(com.palantir.conjure.spec.ParameterType) Objects(java.util.Objects) List(java.util.List) TypeName(com.squareup.javapoet.TypeName) Optional(java.util.Optional) TypeMarker(com.palantir.dialogue.TypeMarker) PrimitiveType(com.palantir.conjure.spec.PrimitiveType) EndpointDefinition(com.palantir.conjure.spec.EndpointDefinition) ListType(com.palantir.conjure.spec.ListType) Auth(com.palantir.conjure.java.services.Auth) ExternalReference(com.palantir.conjure.spec.ExternalReference) FieldSpec(com.squareup.javapoet.FieldSpec) Type(com.palantir.conjure.spec.Type) PathParameterType(com.palantir.conjure.spec.PathParameterType) TypeDefinitionVisitor(com.palantir.conjure.visitor.TypeDefinitionVisitor) Serializer(com.palantir.dialogue.Serializer) PlainSerDe(com.palantir.dialogue.PlainSerDe) SafeArg(com.palantir.logsafe.SafeArg) ConjureRuntime(com.palantir.dialogue.ConjureRuntime) SetType(com.palantir.conjure.spec.SetType) Request(com.palantir.dialogue.Request) CodeBlock(com.squareup.javapoet.CodeBlock) EndpointChannelFactory(com.palantir.dialogue.EndpointChannelFactory) TypeDefinition(com.palantir.conjure.spec.TypeDefinition) MethodSpec(com.squareup.javapoet.MethodSpec) CookieAuthType(com.palantir.conjure.spec.CookieAuthType) ParameterizedTypeName(com.squareup.javapoet.ParameterizedTypeName) TypeSpec(com.squareup.javapoet.TypeSpec) EndpointName(com.palantir.conjure.spec.EndpointName) EndpointChannel(com.palantir.dialogue.EndpointChannel) QueryParameterType(com.palantir.conjure.spec.QueryParameterType) AnnotationSpec(com.squareup.javapoet.AnnotationSpec) HeaderParameterType(com.palantir.conjure.spec.HeaderParameterType) ArgumentDefinition(com.palantir.conjure.spec.ArgumentDefinition) TypeName(com.squareup.javapoet.TypeName) ParameterizedTypeName(com.squareup.javapoet.ParameterizedTypeName) ParameterSpec(com.squareup.javapoet.ParameterSpec) MethodSpec(com.squareup.javapoet.MethodSpec) CodeBlock(com.squareup.javapoet.CodeBlock) Request(com.palantir.dialogue.Request)

Example 4 with Type

use of com.palantir.conjure.spec.Type in project conjure-java by palantir.

the class BeanBuilderAuxiliarySettersUtils method widenParameterIfPossible.

public static TypeName widenParameterIfPossible(TypeName current, Type type, TypeMapper typeMapper) {
    if (type.accept(TypeVisitor.IS_LIST)) {
        Type innerType = type.accept(TypeVisitor.LIST).getItemType();
        TypeName innerTypeName = typeMapper.getClassName(innerType).box();
        if (isWidenableContainedType(innerType)) {
            innerTypeName = WildcardTypeName.subtypeOf(innerTypeName);
        }
        return ParameterizedTypeName.get(ClassName.get(Iterable.class), innerTypeName);
    }
    if (type.accept(TypeVisitor.IS_SET)) {
        Type innerType = type.accept(TypeVisitor.SET).getItemType();
        TypeName innerTypeName = typeMapper.getClassName(innerType).box();
        if (isWidenableContainedType(innerType)) {
            innerTypeName = WildcardTypeName.subtypeOf(innerTypeName);
        }
        return ParameterizedTypeName.get(ClassName.get(Iterable.class), innerTypeName);
    }
    if (type.accept(TypeVisitor.IS_OPTIONAL)) {
        Type innerType = type.accept(TypeVisitor.OPTIONAL).getItemType();
        if (!isWidenableContainedType(innerType)) {
            return current;
        }
        TypeName innerTypeName = typeMapper.getClassName(innerType).box();
        return ParameterizedTypeName.get(ClassName.get(Optional.class), WildcardTypeName.subtypeOf(innerTypeName));
    }
    return current;
}
Also used : Type(com.palantir.conjure.spec.Type) MapType(com.palantir.conjure.spec.MapType) OptionalType(com.palantir.conjure.spec.OptionalType) PrimitiveType(com.palantir.conjure.spec.PrimitiveType) WildcardTypeName(com.squareup.javapoet.WildcardTypeName) ParameterizedTypeName(com.squareup.javapoet.ParameterizedTypeName) TypeName(com.squareup.javapoet.TypeName) Optional(java.util.Optional)

Example 5 with Type

use of com.palantir.conjure.spec.Type in project conjure-java by palantir.

the class BeanGenerator method generateStageInterfaces.

private static List<TypeSpec> generateStageInterfaces(ClassName objectClass, ClassName builderClass, TypeMapper typeMapper, ImmutableList<EnrichedField> fieldsNeedingBuilderStage, ImmutableList<EnrichedField> otherFields) {
    List<TypeSpec.Builder> interfaces = new ArrayList<>();
    PeekingIterator<EnrichedField> fieldPeekingIterator = Iterators.peekingIterator(sortedEnrichedFields(fieldsNeedingBuilderStage).iterator());
    while (fieldPeekingIterator.hasNext()) {
        EnrichedField field = fieldPeekingIterator.next();
        String nextBuilderStageName = fieldPeekingIterator.hasNext() ? JavaNameSanitizer.sanitize(fieldPeekingIterator.peek().fieldName()) : "completed_";
        ClassName nextStageClassName = stageBuilderInterfaceName(objectClass, nextBuilderStageName);
        interfaces.add(TypeSpec.interfaceBuilder(stageBuilderInterfaceName(objectClass, JavaNameSanitizer.sanitize(field.fieldName()))).addModifiers(Modifier.PUBLIC).addMethod(MethodSpec.methodBuilder(JavaNameSanitizer.sanitize(field.fieldName())).addParameter(ParameterSpec.builder(field.poetSpec().type, JavaNameSanitizer.sanitize(field.fieldName())).addAnnotation(Nonnull.class).build()).addModifiers(Modifier.PUBLIC, Modifier.ABSTRACT).returns(nextStageClassName.box()).build()));
    }
    ClassName completedStageClass = stageBuilderInterfaceName(objectClass, "completed_");
    TypeSpec.Builder completedStage = TypeSpec.interfaceBuilder(completedStageClass).addModifiers(Modifier.PUBLIC).addMethod(MethodSpec.methodBuilder("build").addModifiers(Modifier.PUBLIC, Modifier.ABSTRACT).returns(objectClass.box()).build());
    completedStage.addMethods(otherFields.stream().map(field -> generateMethodsForFinalStageField(field, typeMapper, completedStageClass)).flatMap(List::stream).collect(Collectors.toList()));
    interfaces.add(completedStage);
    interfaces.get(0).addMethod(MethodSpec.methodBuilder("from").addModifiers(Modifier.PUBLIC, Modifier.ABSTRACT).returns(builderClass).addParameter(objectClass, "other").build());
    return interfaces.stream().map(TypeSpec.Builder::build).collect(Collectors.toList());
}
Also used : DefaultTypeVisitor(com.palantir.conjure.java.visitor.DefaultTypeVisitor) JsonProperty(com.fasterxml.jackson.annotation.JsonProperty) TypeVisitor(com.palantir.conjure.visitor.TypeVisitor) Modifier(javax.lang.model.element.Modifier) Javadoc(com.palantir.conjure.java.util.Javadoc) ClassName(com.squareup.javapoet.ClassName) Collections2(com.google.common.collect.Collections2) PeekingIterator(com.google.common.collect.PeekingIterator) StringUtils(org.apache.commons.lang3.StringUtils) Options(com.palantir.conjure.java.Options) MapType(com.palantir.conjure.spec.MapType) Map(java.util.Map) OptionalType(com.palantir.conjure.spec.OptionalType) MoreVisitors(com.palantir.conjure.java.visitor.MoreVisitors) ObjectDefinition(com.palantir.conjure.spec.ObjectDefinition) ParameterSpec(com.squareup.javapoet.ParameterSpec) Collection(java.util.Collection) SafeIllegalArgumentException(com.palantir.logsafe.exceptions.SafeIllegalArgumentException) FieldDefinition(com.palantir.conjure.spec.FieldDefinition) Collectors(java.util.stream.Collectors) JavaFile(com.squareup.javapoet.JavaFile) List(java.util.List) Stream(java.util.stream.Stream) TypeName(com.squareup.javapoet.TypeName) Optional(java.util.Optional) CaseConverter(com.palantir.conjure.CaseConverter) PrimitiveType(com.palantir.conjure.spec.PrimitiveType) JsonDeserialize(com.fasterxml.jackson.databind.annotation.JsonDeserialize) JsonIgnoreProperties(com.fasterxml.jackson.annotation.JsonIgnoreProperties) Iterables(com.google.common.collect.Iterables) ListType(com.palantir.conjure.spec.ListType) TypeFunctions(com.palantir.conjure.java.util.TypeFunctions) FieldSpec(com.squareup.javapoet.FieldSpec) Type(com.palantir.conjure.spec.Type) Iterators(com.google.common.collect.Iterators) ArrayList(java.util.ArrayList) SafeArg(com.palantir.logsafe.SafeArg) ImmutableList(com.google.common.collect.ImmutableList) Value(org.immutables.value.Value) JsonSerialize(com.fasterxml.jackson.databind.annotation.JsonSerialize) SetType(com.palantir.conjure.spec.SetType) Nonnull(javax.annotation.Nonnull) CodeBlock(com.squareup.javapoet.CodeBlock) TypeDefinition(com.palantir.conjure.spec.TypeDefinition) MethodSpec(com.squareup.javapoet.MethodSpec) Packages(com.palantir.conjure.java.util.Packages) JavaNameSanitizer(com.palantir.conjure.java.util.JavaNameSanitizer) ParameterizedTypeName(com.squareup.javapoet.ParameterizedTypeName) TypeSpec(com.squareup.javapoet.TypeSpec) AnnotationSpec(com.squareup.javapoet.AnnotationSpec) ConjureAnnotations(com.palantir.conjure.java.ConjureAnnotations) JsonInclude(com.fasterxml.jackson.annotation.JsonInclude) FieldName(com.palantir.conjure.spec.FieldName) Comparator(java.util.Comparator) Collections(java.util.Collections) Nonnull(javax.annotation.Nonnull) ArrayList(java.util.ArrayList) ClassName(com.squareup.javapoet.ClassName) List(java.util.List) ArrayList(java.util.ArrayList) ImmutableList(com.google.common.collect.ImmutableList) TypeSpec(com.squareup.javapoet.TypeSpec)

Aggregations

Type (com.palantir.conjure.spec.Type)23 PrimitiveType (com.palantir.conjure.spec.PrimitiveType)19 OptionalType (com.palantir.conjure.spec.OptionalType)17 ListType (com.palantir.conjure.spec.ListType)16 SetType (com.palantir.conjure.spec.SetType)15 MapType (com.palantir.conjure.spec.MapType)13 MethodSpec (com.squareup.javapoet.MethodSpec)12 AnnotationSpec (com.squareup.javapoet.AnnotationSpec)11 CodeBlock (com.squareup.javapoet.CodeBlock)11 ParameterizedTypeName (com.squareup.javapoet.ParameterizedTypeName)11 TypeName (com.squareup.javapoet.TypeName)11 TypeDefinition (com.palantir.conjure.spec.TypeDefinition)10 FieldSpec (com.squareup.javapoet.FieldSpec)10 TypeSpec (com.squareup.javapoet.TypeSpec)10 List (java.util.List)10 Optional (java.util.Optional)10 Options (com.palantir.conjure.java.Options)9 FieldDefinition (com.palantir.conjure.spec.FieldDefinition)9 ClassName (com.squareup.javapoet.ClassName)9 Modifier (javax.lang.model.element.Modifier)9