private void enrichWithAnnotations(WithAnnotation withAnnotationBuilder, Set<TypeAnnotation> annotations) { annotations.forEach(typeAnnotation -> withAnnotationBuilder.with(typeAnnotation)); } });
private <T extends TypeBuilder & WithAnnotation> MetadataType withNewAnnotations(T builder) { Set<TypeAnnotation> all = getAllTypeAnnotations(); for (TypeAnnotation typeAnnotation : all) { builder.with(typeAnnotation); } return builder.build(); }
/** * Gives a type alias to type specified by builder. * * @param typeBuilder The type builder to annotate. * @param typeAlias The type alias to use. */ public static void addTypeAlias(TypeBuilder typeBuilder, String typeAlias) { if (typeAlias == null || typeBuilder == null) { return; } if (typeBuilder instanceof WithAnnotation) { final WithAnnotation withAnnotation = (WithAnnotation) typeBuilder; withAnnotation.with(new TypeAliasAnnotation(typeAlias)); } }
private <T extends TypeBuilder & WithAnnotation> MetadataType withNewAnnotations(T builder) { Set<TypeAnnotation> all = getAllTypeAnnotations(); for (TypeAnnotation typeAnnotation : all) { builder.with(typeAnnotation); } return builder.build(); }