Search in sources :

Example 1 with TypeParamDefColletor

use of io.sundr.dsl.internal.visitors.TypeParamDefColletor in project sundrio by sundrio.

the class Combine method extractParameters.

private static final Set<TypeParamDef> extractParameters(ClassRef classRef) {
    final Set<TypeParamDef> result = new LinkedHashSet<TypeParamDef>();
    final Set<TypeParamRef> refs = new LinkedHashSet<TypeParamRef>();
    ClassRef ignored = new ClassRefBuilder(classRef).accept(new TypeParamDefColletor(result)).accept(new TypeParamRefColletor(refs)).build();
    for (TypeParamRef typeParamRef : refs) {
        result.add(new TypeParamDefBuilder().withName(typeParamRef.getName()).withAttributes(typeParamRef.getAttributes()).build());
    }
    return result;
}
Also used : LinkedHashSet(java.util.LinkedHashSet) TypeParamRef(io.sundr.model.TypeParamRef) TypeParamDef(io.sundr.model.TypeParamDef) TypeParamRefColletor(io.sundr.dsl.internal.visitors.TypeParamRefColletor) ClassRef(io.sundr.model.ClassRef) ClassRefBuilder(io.sundr.model.ClassRefBuilder) TypeParamDefBuilder(io.sundr.model.TypeParamDefBuilder) TypeParamDefColletor(io.sundr.dsl.internal.visitors.TypeParamDefColletor)

Example 2 with TypeParamDefColletor

use of io.sundr.dsl.internal.visitors.TypeParamDefColletor in project sundrio by sundrio.

the class Combine method extractParameters.

private static final Set<TypeParamDef> extractParameters(TypeDef typeDef) {
    final Set<TypeParamDef> result = new LinkedHashSet<TypeParamDef>();
    final Set<TypeParamRef> refs = new LinkedHashSet<TypeParamRef>();
    TypeDef ignored = new TypeDefBuilder(typeDef).accept(new TypeParamDefColletor(result)).accept(new TypeParamRefColletor(refs)).build();
    for (TypeParamRef typeParamRef : refs) {
        result.add(new TypeParamDefBuilder().withName(typeParamRef.getName()).withAttributes(typeParamRef.getAttributes()).build());
    }
    return result;
}
Also used : LinkedHashSet(java.util.LinkedHashSet) TypeParamRef(io.sundr.model.TypeParamRef) TypeParamDef(io.sundr.model.TypeParamDef) TypeParamRefColletor(io.sundr.dsl.internal.visitors.TypeParamRefColletor) TypeDef(io.sundr.model.TypeDef) TypeParamDefBuilder(io.sundr.model.TypeParamDefBuilder) TypeParamDefColletor(io.sundr.dsl.internal.visitors.TypeParamDefColletor) TypeDefBuilder(io.sundr.model.TypeDefBuilder)

Aggregations

TypeParamDefColletor (io.sundr.dsl.internal.visitors.TypeParamDefColletor)2 TypeParamRefColletor (io.sundr.dsl.internal.visitors.TypeParamRefColletor)2 TypeParamDef (io.sundr.model.TypeParamDef)2 TypeParamDefBuilder (io.sundr.model.TypeParamDefBuilder)2 TypeParamRef (io.sundr.model.TypeParamRef)2 LinkedHashSet (java.util.LinkedHashSet)2 ClassRef (io.sundr.model.ClassRef)1 ClassRefBuilder (io.sundr.model.ClassRefBuilder)1 TypeDef (io.sundr.model.TypeDef)1 TypeDefBuilder (io.sundr.model.TypeDefBuilder)1