Package io.micronaut.sourcegen.model
Class ObjectDefBuilder<ThisType>
java.lang.Object
io.micronaut.sourcegen.model.AbstractElementBuilder<ThisType>
io.micronaut.sourcegen.model.ObjectDefBuilder<ThisType>
- Type Parameters:
ThisType
- The type of this builder
- Direct Known Subclasses:
ClassDef.ClassDefBuilder
,EnumDef.EnumDefBuilder
,InterfaceDef.InterfaceDefBuilder
,RecordDef.RecordDefBuilder
public sealed class ObjectDefBuilder<ThisType>
extends AbstractElementBuilder<ThisType>
permits ClassDef.ClassDefBuilder, InterfaceDef.InterfaceDefBuilder, RecordDef.RecordDefBuilder, EnumDef.EnumDefBuilder
The abstract builder that is used for specific types: interfaces, classes, records or enums.
- Since:
- 1.3
- Author:
- Andriy Dmytruk
-
Field Summary
Fields inherited from class io.micronaut.sourcegen.model.AbstractElementBuilder
annotations, javadoc, modifiers, name, thisInstance
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionfinal ThisType
addInnerType
(@NonNull ObjectDef innerDef) Add an inner type.final ThisType
addInnerType
(@NonNull Collection<ObjectDef> innerDefs) Add an inner types.final ThisType
Add a method.final ThisType
addMethods
(@NonNull Collection<MethodDef> methods) Add methods.final ThisType
addProperty
(@NonNull PropertyDef property) Add a property.final ThisType
addSuperinterface
(@NonNull TypeDef superinterface) Add a super interface.final ThisType
addSuperinterfaces
(@NonNull Collection<TypeDef> superinterfaces) Add super interfaces.Methods inherited from class io.micronaut.sourcegen.model.AbstractElementBuilder
addAnnotation, addAnnotation, addAnnotation, addAnnotation, addAnnotations, addAnnotations, addJavadoc, addModifiers, addModifiers, overrideModifiers
-
Field Details
-
methods
-
properties
-
superinterfaces
-
innerTypes
-
-
Constructor Details
-
ObjectDefBuilder
-
-
Method Details
-
addMethod
Add a method.- Parameters:
method
- The method.- Returns:
- The builder
-
addMethods
Add methods.- Parameters:
methods
- The method.s- Returns:
- The builder
-
addProperty
Add a property.- Parameters:
property
- The property.- Returns:
- The builder
-
addSuperinterface
Add a super interface.- Parameters:
superinterface
- The interface.- Returns:
- The builder
-
addSuperinterfaces
@NonNull public final ThisType addSuperinterfaces(@NonNull @NonNull Collection<TypeDef> superinterfaces) Add super interfaces.- Parameters:
superinterfaces
- The interfaces.- Returns:
- The builder
-
addInnerType
Add an inner type.- Parameters:
innerDef
- The inner definition.- Returns:
- The builder
-
addInnerType
Add an inner types.- Parameters:
innerDefs
- The inner definitions.- Returns:
- The builder
-