當前位置: 首頁>>代碼示例>>Java>>正文


Java ParameterizedTypeName.get方法代碼示例

本文整理匯總了Java中com.squareup.javapoet.ParameterizedTypeName.get方法的典型用法代碼示例。如果您正苦於以下問題:Java ParameterizedTypeName.get方法的具體用法?Java ParameterizedTypeName.get怎麽用?Java ParameterizedTypeName.get使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在com.squareup.javapoet.ParameterizedTypeName的用法示例。


在下文中一共展示了ParameterizedTypeName.get方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: buildResultWrapperMethod

import com.squareup.javapoet.ParameterizedTypeName; //導入方法依賴的package包/類
@Nonnull
private MethodSpec buildResultWrapperMethod()
{
  final ParameterizedTypeName listType =
    ParameterizedTypeName.get( ClassName.get( List.class ), TypeName.get( getElement().asType() ) );
  return MethodSpec.methodBuilder( "wrap" ).
    addModifiers( Modifier.PROTECTED, Modifier.FINAL ).
    addJavadoc( "If config option enabled, wrap the specified list in an immutable list and return it.\n" +
                "This method should be called by repository extensions when returning list results " +
                "when not using {@link #toList(List)}.\n" ).
    addAnnotation( GeneratorUtil.NONNULL_CLASSNAME ).
    addParameter( ParameterSpec.builder( listType, "list", Modifier.FINAL ).
      addAnnotation( GeneratorUtil.NONNULL_CLASSNAME ).build() ).
    returns( listType ).
    addStatement( "return $T.areRepositoryResultsModifiable() ? $T.unmodifiableList( list ) : list",
                  GeneratorUtil.AREZ_CLASSNAME,
                  Collections.class ).
    build();
}
 
開發者ID:arez,項目名稱:arez,代碼行數:20,代碼來源:ComponentDescriptor.java

示例2: generateConstructors

import com.squareup.javapoet.ParameterizedTypeName; //導入方法依賴的package包/類
private List<MethodSpec> generateConstructors() {
  ParameterizedTypeName classOfTranscodeType =
      ParameterizedTypeName.get(ClassName.get(Class.class), transcodeTypeName);

  TypeName wildcardOfObject = WildcardTypeName.subtypeOf(Object.class);
  ParameterizedTypeName requestBuilderOfWildcardOfObject =
      ParameterizedTypeName.get(ClassName.get(requestBuilderType), wildcardOfObject);

  MethodSpec firstConstructor =
      MethodSpec.constructorBuilder()
          .addParameter(classOfTranscodeType, "transcodeClass")
          .addParameter(requestBuilderOfWildcardOfObject, "other")
      .addStatement("super($N, $N)", "transcodeClass", "other")
      .build();

  ClassName glide = ClassName.get("com.bumptech.glide", "Glide");
  ClassName requestManager = ClassName.get("com.bumptech.glide", "RequestManager");
  MethodSpec secondConstructor =
      MethodSpec.constructorBuilder()
          .addParameter(glide, "glide")
          .addParameter(requestManager, "requestManager")
          .addParameter(classOfTranscodeType, "transcodeClass")
          .addStatement("super($N, $N ,$N)", "glide", "requestManager", "transcodeClass")
          .build();
  return ImmutableList.of(firstConstructor, secondConstructor);
}
 
開發者ID:weiwenqiang,項目名稱:GitHub,代碼行數:27,代碼來源:RequestBuilderGenerator.java

示例3: memberAsBeanStyleParameter

import com.squareup.javapoet.ParameterizedTypeName; //導入方法依賴的package包/類
protected ParameterSpec memberAsBeanStyleParameter() {
    if (memberModel.hasBuilder()) {
        TypeName builderName = poetExtensions.getModelClass(memberModel.getC2jShape()).nestedClass("BuilderImpl");
        return ParameterSpec.builder(builderName, fieldName()).build();
    }
    if (memberModel.isList() && hasBuilder(memberModel.getListModel().getListMemberModel())) {
        TypeName memberName = poetExtensions.getModelClass(memberModel.getListModel().getListMemberModel().getC2jShape())
                                            .nestedClass("BuilderImpl");
        TypeName listType = ParameterizedTypeName.get(ClassName.get(Collection.class), memberName);
        return ParameterSpec.builder(listType, fieldName()).build();
    }
    if (memberModel.isMap() && hasBuilder(memberModel.getMapModel().getValueModel())) {
        TypeName keyType = typeProvider.getTypeNameForSimpleType(memberModel.getMapModel().getKeyModel()
                                                                            .getVariable().getVariableType());
        TypeName valueType = poetExtensions.getModelClass(memberModel.getMapModel().getValueModel().getC2jShape())
                                           .nestedClass("BuilderImpl");
        TypeName mapType = ParameterizedTypeName.get(ClassName.get(Map.class), keyType, valueType);
        return ParameterSpec.builder(mapType, fieldName()).build();
    }

    return memberAsParameter();
}
 
開發者ID:aws,項目名稱:aws-sdk-java-v2,代碼行數:23,代碼來源:AbstractMemberSetters.java

示例4: regionId

import com.squareup.javapoet.ParameterizedTypeName; //導入方法依賴的package包/類
private FieldSpec regionId(Set<String> allRegionIds) {
    CodeBlock.Builder builder = CodeBlock.builder()
            .add("$T.asList(\n$>$>", Arrays.class);
    Iterator<String> iterator = allRegionIds.iterator();
    while (iterator.hasNext()) {
        builder.add("$S", iterator.next());
        if (iterator.hasNext()) {
            builder.add(",\n");
        }
    }
    builder.add("$<$<)");
    TypeName listType = ParameterizedTypeName.get(List.class, String.class);
    return FieldSpec.builder(listType, "REGION_IDS", STATIC, FINAL)
            .initializer(builder.build())
            .build();
}
 
開發者ID:gabrielittner,項目名稱:lazythreetenbp,代碼行數:17,代碼來源:JavaWriter.java

示例5: createFoldSignature

import com.squareup.javapoet.ParameterizedTypeName; //導入方法依賴的package包/類
private MethodSpec.Builder createFoldSignature(Iterable<TypeVariableName> availableTypeVariables)
    throws ParserException {
  MethodSpec.Builder builder =
      MethodSpec.methodBuilder("map")
          .addTypeVariable(FOLD_RETURN_TYPE)
          .addModifiers(Modifier.PUBLIC)
          .returns(FOLD_RETURN_TYPE);

  for (OutputValue arg : values) {
    TypeName visitor =
        ParameterizedTypeName.get(
            ClassName.get(Function.class),
            TypeVariableUtils.withoutMissingTypeVariables(
                arg.parameterizedOutputClass(), availableTypeVariables),
            FOLD_RETURN_TYPE);

    builder.addParameter(
        ParameterSpec.builder(visitor, asCamelCase(arg.name()))
            .addAnnotation(Nonnull.class)
            .build());
  }

  return builder;
}
 
開發者ID:spotify,項目名稱:dataenum,代碼行數:25,代碼來源:MapMethods.java

示例6: mapOfBuildersGetter

import com.squareup.javapoet.ParameterizedTypeName; //導入方法依賴的package包/類
private MethodSpec mapOfBuildersGetter(MemberModel memberModel) {
    TypeName keyType = typeProvider.getTypeNameForSimpleType(memberModel.getMapModel().getKeyModel()
                                                                        .getVariable().getVariableType());
    ClassName valueType = poetExtensions.getModelClass(memberModel.getMapModel().getValueModel().getC2jShape());
    TypeName returnType = ParameterizedTypeName.get(ClassName.get(Map.class), keyType, valueType.nestedClass("Builder"));

    return basicGetter(memberModel,
                       returnType,
                       "return $1N != null ? $2T.mapValues($1N, $3T::toBuilder) : null",
                       memberModel.getVariable().getVariableName(),
                       CollectionUtils.class,
                       valueType);
}
 
開發者ID:aws,項目名稱:aws-sdk-java-v2,代碼行數:14,代碼來源:BeanGetterHelper.java

示例7: generateDownloadOnlyRequestMethod

import com.squareup.javapoet.ParameterizedTypeName; //導入方法依賴的package包/類
/**
 * Overrides the protected downloadOnly method in {@link com.bumptech.glide.RequestBuilder} to
 * return our generated subclass instead.
 */
private MethodSpec generateDownloadOnlyRequestMethod() {
  ParameterizedTypeName generatedRequestBuilderOfFile
      = ParameterizedTypeName.get(generatedRequestBuilderClassName, ClassName.get(File.class));
  return MethodSpec.methodBuilder("getDownloadOnlyRequest")
      .addAnnotation(Override.class)
      .returns(generatedRequestBuilderOfFile)
      .addModifiers(Modifier.PROTECTED)
      .addStatement("return new $T<>($T.class, $N).apply($N)",
          generatedRequestBuilderClassName, File.class, "this",
          "DOWNLOAD_ONLY_OPTIONS")
      .build();
}
 
開發者ID:weiwenqiang,項目名稱:GitHub,代碼行數:17,代碼來源:RequestBuilderGenerator.java

示例8: create

import com.squareup.javapoet.ParameterizedTypeName; //導入方法依賴的package包/類
public FieldSpec create(Column column, VariableElement element, TypeElement entityClass) {
    ColumnType columnType = ColumnType.fromVariable(element);
    ParameterizedTypeName typeName = ParameterizedTypeName.get(ClassName.get(columnType.getColumnClass()), ClassName.get(entityClass));
    String fieldName = NamingUtils.columnFieldName(element.getSimpleName().toString());
    FieldSpec.Builder builder = FieldSpec.builder(typeName, fieldName, Modifier.PUBLIC, Modifier.STATIC, Modifier.FINAL);
    builder.initializer("$T.$N($T.class, $S)", DbColumn.class, columnType.getFactoryMethod(), ClassName.get(entityClass), column.value());
    return builder.build();
}
 
開發者ID:orekyuu,項目名稱:Moco,代碼行數:9,代碼來源:ColumnFieldFactory.java

示例9: getJsConstructorFnType

import com.squareup.javapoet.ParameterizedTypeName; //導入方法依賴的package包/類
@Nonnull
private static ParameterizedTypeName getJsConstructorFnType( @Nonnull final ComponentDescriptor descriptor )
{
  return ParameterizedTypeName.get( COMPONENT_CONSTRUCTOR_FUNCTION_CLASSNAME,
                                    TypeName.get( descriptor.getPropsType().asType() ),
                                    TypeName.get( descriptor.getContextType().asType() ) );
}
 
開發者ID:react4j,項目名稱:react4j,代碼行數:8,代碼來源:Generator.java

示例10: bestGuess

import com.squareup.javapoet.ParameterizedTypeName; //導入方法依賴的package包/類
public static TypeName bestGuess(String type) {
    switch (type) {
        case "void":
            return TypeName.VOID;
        case "boolean":
            return TypeName.BOOLEAN;
        case "byte":
            return TypeName.BYTE;
        case "char":
            return TypeName.CHAR;
        case "double":
            return TypeName.DOUBLE;
        case "float":
            return TypeName.FLOAT;
        case "int":
            return TypeName.INT;
        case "long":
            return TypeName.LONG;
        case "short":
            return TypeName.SHORT;
        default:
            int left = type.indexOf('<');
            if (left != -1) {
                ClassName typeClassName = ClassName.bestGuess(type.substring(0, left));
                List<TypeName> typeArguments = new ArrayList<>();
                do {
                    typeArguments.add(WildcardTypeName.subtypeOf(Object.class));
                    left = type.indexOf('<', left + 1);
                } while (left != -1);
                return ParameterizedTypeName.get(typeClassName,
                        typeArguments.toArray(new TypeName[typeArguments.size()]));
            }
            return ClassName.bestGuess(type);
    }
}
 
開發者ID:wangjiegulu,項目名稱:RapidRouter,代碼行數:36,代碼來源:EasyType.java

示例11: generateConstructors

import com.squareup.javapoet.ParameterizedTypeName; //導入方法依賴的package包/類
private List<MethodSpec> generateConstructors() {
  ParameterizedTypeName classOfTranscodeType =
      ParameterizedTypeName.get(ClassName.get(Class.class), transcodeTypeName);

  TypeName wildcardOfObject = WildcardTypeName.subtypeOf(Object.class);
  ParameterizedTypeName requestBuilderOfWildcardOfObject =
      ParameterizedTypeName.get(ClassName.get(requestBuilderType), wildcardOfObject);

  MethodSpec firstConstructor =
      MethodSpec.constructorBuilder()
          .addParameter(classOfTranscodeType, "transcodeClass")
          .addParameter(requestBuilderOfWildcardOfObject, "other")
      .addStatement("super($N, $N)", "transcodeClass", "other")
      .build();

  ClassName context = ClassName.get("android.content", "Context");
  ClassName glide = ClassName.get("com.bumptech.glide", "Glide");
  ClassName requestManager = ClassName.get("com.bumptech.glide", "RequestManager");
  MethodSpec secondConstructor =
      MethodSpec.constructorBuilder()
          .addParameter(glide, "glide")
          .addParameter(requestManager, "requestManager")
          .addParameter(classOfTranscodeType, "transcodeClass")
          .addParameter(context, "context")
          .addStatement(
              "super($N, $N ,$N, $N)", "glide", "requestManager", "transcodeClass", "context")
          .build();
  return ImmutableList.of(firstConstructor, secondConstructor);
}
 
開發者ID:weiwenqiang,項目名稱:GitHub,代碼行數:30,代碼來源:RequestBuilderGenerator.java

示例12: generateDownloadOnlyRequestMethod

import com.squareup.javapoet.ParameterizedTypeName; //導入方法依賴的package包/類
/**
 * Overrides the protected downloadOnly method in {@code com.bumptech.glide.RequestBuilder} to
 * return our generated subclass instead.
 */
private MethodSpec generateDownloadOnlyRequestMethod() {
  ParameterizedTypeName generatedRequestBuilderOfFile
      = ParameterizedTypeName.get(generatedRequestBuilderClassName, ClassName.get(File.class));
  return MethodSpec.methodBuilder("getDownloadOnlyRequest")
      .addAnnotation(Override.class)
      .addAnnotation(AnnotationSpec.builder(CHECK_RESULT_CLASS_NAME).build())
      .returns(generatedRequestBuilderOfFile)
      .addModifiers(Modifier.PROTECTED)
      .addStatement("return new $T<>($T.class, $N).apply($N)",
          generatedRequestBuilderClassName, File.class, "this",
          "DOWNLOAD_ONLY_OPTIONS")
      .build();
}
 
開發者ID:weiwenqiang,項目名稱:GitHub,代碼行數:18,代碼來源:RequestBuilderGenerator.java

示例13: generate

import com.squareup.javapoet.ParameterizedTypeName; //導入方法依賴的package包/類
public TypeSpec generate() {
    final TypeVariableName T = TypeVariableName.get("T");
    final TypeName LIST_OF_T = ParameterizedTypeName.get(ClassName.get("java.util", "List"), T);

    final TypeName RETURN_T = ProcessUtils.observableOf(T);
    final TypeName RETURN_LIST_T = ProcessUtils.observableOf(LIST_OF_T);

    return TypeSpec.interfaceBuilder(Constants.DATABASE_COMMON_INTERFACE_NAME)
            .addModifiers(Modifier.PUBLIC)
            .addTypeVariable(T)


            .addMethod(MethodSpec.methodBuilder("select")
                    .addModifiers(Modifier.PUBLIC, Modifier.ABSTRACT)
                    .returns(Constants.queryBuilderClassName)
                    .build())

            .addMethod(MethodSpec.methodBuilder("add")
                    .addModifiers(Modifier.PUBLIC, Modifier.ABSTRACT)
                    .addParameter(T, "object", Modifier.FINAL)
                    .returns(RETURN_T)
                    .build())

            .addMethod(MethodSpec.methodBuilder("add")
                    .addModifiers(Modifier.PUBLIC, Modifier.ABSTRACT)
                    .addParameter(LIST_OF_T, "objects", Modifier.FINAL)
                    .returns(RETURN_LIST_T)
                    .build())

            .addMethod(MethodSpec.methodBuilder("update")
                    .addModifiers(Modifier.PUBLIC, Modifier.ABSTRACT)
                    .addParameter(T, "object", Modifier.FINAL)
                    .returns(RETURN_T)
                    .build())

            .addMethod(MethodSpec.methodBuilder("update")
                    .addModifiers(Modifier.PUBLIC, Modifier.ABSTRACT)
                    .addParameter(LIST_OF_T, "objects", Modifier.FINAL)
                    .returns(RETURN_LIST_T)
                    .build())

            .addMethod(MethodSpec.methodBuilder("delete")
                    .addModifiers(Modifier.PUBLIC, Modifier.ABSTRACT)
                    .addParameter(T, "object", Modifier.FINAL)
                    .returns(ProcessUtils.observableOf(TypeName.BOOLEAN.box()))
                    .build())

            .addMethod(MethodSpec.methodBuilder("delete")
                    .addModifiers(Modifier.PUBLIC, Modifier.ABSTRACT)
                    .addParameter(LIST_OF_T, "objects", Modifier.FINAL)
                    .returns(ProcessUtils.observableOf(TypeName.BOOLEAN.box()))
                    .build())

            .addMethod(MethodSpec.methodBuilder("deleteAll")
                    .addModifiers(Modifier.PUBLIC, Modifier.ABSTRACT)
                    .returns(ProcessUtils.observableOf(TypeName.BOOLEAN.box()))
                    .build())

            .addMethod(MethodSpec.methodBuilder("count")
                    .addModifiers(Modifier.PUBLIC, Modifier.ABSTRACT)
                    .returns(ProcessUtils.observableOf(TypeName.INT.box()))
                    .build())

            .build();
}
 
開發者ID:florent37,項目名稱:RxAndroidOrm,代碼行數:66,代碼來源:ModelORMInterfaceGenerator.java

示例14: updateRegistry

import com.squareup.javapoet.ParameterizedTypeName; //導入方法依賴的package包/類
@Override
public void updateRegistry(TypeSpec.Builder registry, UserMarkerAnnotation annotation) {

    TypeName retType = annotation.getServiceInterfaceTypeName();
    TypeSpec.Builder deserializerBuilder = TypeSpec.classBuilder(DESERIALIZER_CLASS)
            .superclass(ParameterizedTypeName.get(ClassName.get(StdDeserializer.class), retType))
            .addModifiers(Modifier.PUBLIC)
            .addModifiers(Modifier.STATIC)
            .addModifiers(Modifier.FINAL)
            .addMethod(MethodSpec.constructorBuilder().addStatement("this(null)").build())
            .addMethod(MethodSpec.constructorBuilder().addParameter(Class.class, "clazz").addStatement("super(clazz)").build());

    String jsonParser = "jsonParser";
    String registeredName = "registeredName";
    String node = "node";
    String fieldNames = "fieldNames";
    MethodSpec deserializerMethod = MethodSpec.methodBuilder("deserialize")
            .addModifiers(Modifier.PUBLIC)
            .addParameter(JsonParser.class, jsonParser)
            .addParameter(DeserializationContext.class, "ctxt")
            .addException(IOException.class)
            .addException(JsonProcessingException.class)
            .returns(annotation.getServiceInterfaceTypeName())
            .addStatement("$T $L", String.class, registeredName)
            .beginControlFlow("if ($L.isExpectedStartObjectToken())", jsonParser)
            .addStatement("$T $L = $L.getCodec().readTree($L)", TreeNode.class, node, jsonParser, jsonParser)
            // Check that object has exactly one key
            .addComment("Check that object has exactly one key")
            .addStatement("$T $L = $L.fieldNames()", ITERATOR_STRING, fieldNames, node)
            .beginControlFlow("if (!$L.hasNext())", fieldNames)
            // No keys; throw an exception
            .addComment("No keys; throw an exception")
            .addStatement(String.format("throw new RuntimeException(\"Failed to deserialize %s: no field names found\")", annotation.getServiceInterfaceName()))
            .endControlFlow()
            // At least one key; get the registered name
            .addComment("At least one key; get the registered name")
            .addStatement("$L = $L.next()", registeredName, fieldNames)
            .beginControlFlow("if ($L.hasNext())", fieldNames)
            .addComment("Too many keys; input is malformed")
            .addStatement(String.format("throw new RuntimeException(\"Failed to deserialize %s: too many field names found\")", annotation.getServiceInterfaceName()))
            .endControlFlow()
            .addComment("Check that service is registered and initialize")
            .beginControlFlow("if (getInstance().$L.containsKey($L))", "pluginMap", registeredName)
            .addStatement("return getInstance().$L.get($L).deserialize($L.get($L).traverse($L.getCodec()))", "pluginMap", registeredName, node, registeredName, jsonParser)
            .nextControlFlow("else")
            .addStatement(String.format("throw new RuntimeException($T.format(\"Failed to deserialize %s: Service \\\"%%s\\\" not found in registry\", $L))",
                    annotation.getServiceInterfaceName()), String.class, registeredName)
            .endControlFlow()
            .nextControlFlow("else")
            .addComment("Not an object; assume we're working with a string that corresponds to a configuration-less service")
            .addStatement("$L = $L.getValueAsString()", registeredName, jsonParser)
            .addComment("Check that service is registered and initialize")
            .beginControlFlow("if (getInstance().$L.containsKey($L))", "pluginMap", registeredName)
            .addStatement("return getInstance().$L.get($L).deserialize()", "pluginMap", registeredName)
            .nextControlFlow("else")
            .addStatement(String.format("throw new RuntimeException($T.format(\"Failed to deserialize %s: Service \\\"%%s\\\" not found in registry\", $L))",
                    annotation.getServiceInterfaceName()), String.class, registeredName)
            .endControlFlow()
            .endControlFlow()
            .build();

    deserializerBuilder = deserializerBuilder.addMethod(deserializerMethod);

    TypeName configType = ParameterizedTypeName.get(ClassName.get(TypeReference.class), WildcardTypeName.subtypeOf(Object.class));
    String serviceName = "serviceName";
    MethodSpec getConfigTypeReference = MethodSpec.methodBuilder("getConfigTypeReference")
            .addModifiers(Modifier.PUBLIC)
            .addModifiers(Modifier.STATIC)
            .addParameter(String.class, serviceName)
            .returns(configType)
            .beginControlFlow("if (getInstance().$L.containsKey($L))", "pluginMap", serviceName)
            .addStatement("return getInstance().$L.get($L).getConfigTypeReference()", "pluginMap", serviceName)
            .nextControlFlow("else")
            .addStatement("return null")
            .endControlFlow()
            .build();

    registry.addType(deserializerBuilder.build());
    registry.addMethod(getConfigTypeReference);
}
 
開發者ID:c0d3d,項目名稱:easy-plugins,代碼行數:81,代碼來源:JacksonEasyPluginPlugin.java

示例15: generate

import com.squareup.javapoet.ParameterizedTypeName; //導入方法依賴的package包/類
TypeSpec generate(String generatedCodePackageName, @Nullable TypeSpec generatedOptions) {
  generatedRequestBuilderClassName =
      ClassName.get(generatedCodePackageName, GENERATED_REQUEST_BUILDER_SIMPLE_NAME);
  generatedRequestBuilderOfTranscodeType =
      ParameterizedTypeName.get(generatedRequestBuilderClassName, transcodeTypeName);

  if (generatedOptions != null) {
    requestOptionsClassName =
        ClassName.get(generatedCodePackageName, generatedOptions.name);
  } else {
    requestOptionsClassName =
        ClassName.get(
            RequestOptionsGenerator.REQUEST_OPTIONS_PACKAGE_NAME,
            RequestBuilderGenerator.REQUEST_OPTIONS_SIMPLE_NAME);
  }

  ParameterizedTypeName requestBuilderOfTranscodeType =
      ParameterizedTypeName.get(
          ClassName.get(REQUEST_BUILDER_PACKAGE_NAME, REQUEST_BUILDER_SIMPLE_NAME),
          transcodeTypeName);

  return TypeSpec.classBuilder(GENERATED_REQUEST_BUILDER_SIMPLE_NAME)
      .addJavadoc("Contains all public methods from {@link $T}, all options from\n",
          requestBuilderType)
      .addJavadoc("{@link $T} and all generated options from\n", requestOptionsType)
      .addJavadoc("{@link $T} in annotated methods in\n", GlideOption.class)
      .addJavadoc("{@link $T} annotated classes.\n", GlideExtension.class)
      .addJavadoc("\n")
      .addJavadoc("<p>Generated code, do not modify.\n")
      .addJavadoc("\n")
      .addJavadoc("@see $T\n", requestBuilderType)
      .addJavadoc("@see $T\n", requestOptionsType)
      .addAnnotation(
          AnnotationSpec.builder(SuppressWarnings.class)
              .addMember("value", "$S", "unused")
              .addMember("value", "$S", "deprecation")
              .build())
      .addModifiers(Modifier.PUBLIC, Modifier.FINAL)
      .addTypeVariable(transcodeTypeName)
      .superclass(requestBuilderOfTranscodeType)
      .addMethods(generateConstructors())
      .addMethod(generateDownloadOnlyRequestMethod())
      .addMethods(generateGeneratedRequestOptionsEquivalents(generatedOptions))
      .addMethods(generateRequestBuilderOverrides())
      .build();
}
 
開發者ID:weiwenqiang,項目名稱:GitHub,代碼行數:47,代碼來源:RequestBuilderGenerator.java


注:本文中的com.squareup.javapoet.ParameterizedTypeName.get方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。