Tabnine Logo
TypeUtils.typeGenericOf
Code IndexAdd Tabnine to your IDE (free)

How to use
typeGenericOf
method
in
io.sundr.codegen.utils.TypeUtils

Best Java code snippets using io.sundr.codegen.utils.TypeUtils.typeGenericOf (Showing top 11 results out of 315)

origin: io.sundr/sundr-annotations

public JavaType apply(JavaType item) {
  return typeGenericOf(Constants.ARRAY_LIST, item);
}
origin: io.sundr/sundr-annotations

  @Override
  public JavaType apply(JavaType item) {
    JavaType fluent = SHALLOW_FLUENT.apply(item);
    List<JavaType> generics = new ArrayList<JavaType>();
    for (JavaType generic : item.getGenericTypes()) {
      generics.add(generic);
    }
    return new JavaTypeBuilder(item)
        .withGenericTypes(generics.toArray(new JavaType[generics.size()]))
        .withSuperClass(typeGenericOf(fluent, SHALLOW_INLINEABLE.apply(item)))
        .build();
  }
}, SHALLOW_BUILDER {
origin: io.sundr/sundr-annotations

  @Override
  public JavaType apply(JavaType item) {
    List<JavaType> generics = new ArrayList<JavaType>();
    for (JavaType generic : item.getGenericTypes()) {
      generics.add(generic);
    }
    JavaType builder = SHALLOW_BUILDER.apply(item);
    generics.add(builder);
    JavaType fluent = typeGenericOf(SHALLOW_FLUENT.apply(item), generics.toArray(new JavaType[generics.size()]));
    generics.remove(builder);
    return new JavaTypeBuilder(item)
        .withClassName(item.getClassName() + "Builder")
        .withGenericTypes(generics.toArray(new JavaType[generics.size()]))
        .withSuperClass(fluent)
        .withInterfaces(new HashSet(Arrays.asList(typeGenericOf(BuilderContextManager.getContext().getVisitableBuilderInterface().getType(), item, builder))))
        .build();
  }
}, EDITABLE {
origin: io.sundr/sundr-annotations

  @Override
  public JavaType apply(JavaType item) {
    List<JavaType> generics = new ArrayList<JavaType>();
    for (JavaType generic : item.getGenericTypes()) {
      generics.add(generic);
    }
    return new JavaTypeBuilder(item)
        .withClassName("Editable" + item.getClassName())
        .withGenericTypes(generics.toArray(new JavaType[generics.size()]))
        .withSuperClass(item)
        .withInterfaces(new HashSet(Arrays.asList(typeGenericOf(BuilderContextManager.getContext().getEditableInterface().getType(), SHALLOW_BUILDER.apply(item)))))
        .build();
  }
}, SHALLOW_INLINEABLE {
origin: io.sundr/sundr-annotations

  JavaClazz inlineableOf(BuilderContext ctx, JavaClazz clazz, Inline inline) {
    JavaClazz base = ClazzAs.INLINEABLE.apply(clazz);
    JavaType baseInterface = typeGenericOf(BuilderUtils.getInlineType(ctx, inline), clazz.getType());
    JavaMethod method = new JavaMethodBuilder(base.getMethods().iterator().next()).withName(inline.value()).build();

    JavaType fluent = TypeAs.SHALLOW_FLUENT.apply(clazz.getType());
    JavaType shallowInlineType = new JavaTypeBuilder(base.getType())
        .withClassName(inline.prefix() + base.getType().getClassName() + inline.suffix())
        .addToInterfaces(baseInterface)
        .build();

    JavaType inlineType = new JavaTypeBuilder(shallowInlineType)
        .withSuperClass(typeGenericOf(fluent, shallowInlineType))
        .build();

    Set<JavaMethod> constructors = new LinkedHashSet<JavaMethod>();
    for (JavaMethod constructor : base.getConstructors()) {
      constructors.add(new JavaMethodBuilder(constructor).withReturnType(inlineType).build());
    }

    return new JavaClazzBuilder(base)
        .withType(inlineType)
        .withConstructors(constructors)
        .withMethods(new HashSet<JavaMethod>(Arrays.asList(method)))
        .build();
  }
}
origin: io.sundr/sundr-annotations

builderType = typeGenericOf(toAdd.getType(), builderType);
  builderType = typeGenericOf(descendant.getType(), builderType);
origin: sundrio/sundrio

String builderName = "build" + property.getNameCapitalized();
TypeRef unwrapped = TypeAs.combine(TypeAs.UNWRAP_COLLECTION_OF, TypeAs.UNWRAP_ARRAY_OF).apply(property.getTypeRef());
TypeDef predicate = typeGenericOf(BuilderContextManager.getContext().getPredicateClass(), T);
origin: io.sundr/sundr-annotations

.withGenericTypes(BASE_FLUENT.getGenericTypes())
.addToInterfaces(fluentInterface.getType())
.addToInterfaces(typeGenericOf(visitableInterface.getType(),T))
.and()
.addNewMethod()
  .addToModifiers(Modifier.PUBLIC)
  .withName("build")
  .withReturnType(typeGenericOf(ARRAY_LIST, T))
  .addNewArgument()
    .withType(typeGenericOf(LIST, typeExtends(Q, typeGenericOf(builderInterface.getType(), T))))
    .withName("list")
  .endArgument()
  .addToModifiers(Modifier.PUBLIC)
    .withName("build")
    .withReturnType(typeGenericOf(LINKED_HASH_SET, T))
    .addNewArgument()
      .withType(typeGenericOf(LINKED_HASH_SET, typeExtends(Q, typeGenericOf(builderInterface.getType(), T))))
      .withName("set")
    .endArgument()
  .addToModifiers(Modifier.PUBLIC)
  .withName("aggregate")
  .withReturnType(typeGenericOf(ARRAY_LIST, T))
  .addNewArgument()
    .withType(typeGenericOf(LIST, typeExtends(Q, T)))
    .withName("...lists")
  .endArgument()
origin: sundrio/sundrio

TypeRef unwrapped = TypeAs.combine(TypeAs.UNWRAP_COLLECTION_OF, TypeAs.UNWRAP_ARRAY_OF, TypeAs.UNWRAP_OPTIONAL_OF).apply(property.getTypeRef());
TypeDef predicate = typeGenericOf(BuilderContextManager.getContext().getPredicateClass(), T);
String prefix = Getter.prefix(property);
String getterName = Getter.name(property);
origin: sundrio/sundrio

TypeDef predicate = typeGenericOf(BuilderContextManager.getContext().getPredicateClass(), T);
origin: io.sundr/sundr-annotations

.withType(typeGenericOf(BuilderContextManager.getContext().getVisitorInterface().getType(), item.getType()))
.withName("visitor")
.addToModifiers(Modifier.PRIVATE)
io.sundr.codegen.utilsTypeUtilstypeGenericOf

Javadoc

Sets one io.sundr.codegen.model.TypeDef as a generic of an other.

Popular methods of TypeUtils

  • modifiersToInt
  • allProperties
  • isCollection
  • isOptional
  • visitParents
  • fullyQualifiedNameDiff
  • getParameterDefinition
  • hasProperty
    Checks if property exists on the specified type.
  • isAbstract
    Checks a TypeRef is of an abstract type.
  • isArray
    Checks if a TypeRef is an array.
  • isBoolean
    Checks if a TypeRef is a Boolean or boolean.
  • isInstanceOf
    Checks if a TypeDef is an instance of an other TypeDef.
  • isBoolean,
  • isInstanceOf,
  • isList,
  • isMap,
  • isOptionalDouble,
  • isOptionalInt,
  • isOptionalLong,
  • isPrimitive,
  • isSet

Popular in Java

  • Parsing JSON documents to java classes using gson
  • getContentResolver (Context)
  • requestLocationUpdates (LocationManager)
  • orElseThrow (Optional)
    Return the contained value, if present, otherwise throw an exception to be created by the provided s
  • FileInputStream (java.io)
    An input stream that reads bytes from a file. File file = ...finally if (in != null) in.clos
  • OutputStream (java.io)
    A writable sink for bytes.Most clients will use output streams that write data to the file system (
  • Charset (java.nio.charset)
    A charset is a named mapping between Unicode characters and byte sequences. Every Charset can decode
  • Connection (java.sql)
    A connection represents a link from a Java application to a database. All SQL statements and results
  • Executor (java.util.concurrent)
    An object that executes submitted Runnable tasks. This interface provides a way of decoupling task s
  • Loader (org.hibernate.loader)
    Abstract superclass of object loading (and querying) strategies. This class implements useful common
  • CodeWhisperer alternatives
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now