Class WitherGenerator
java.lang.Object
io.micronaut.sourcegen.generator.visitors.WitherGenerator
Provides methods for creating withers from other processors.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptioncreateWither
(String packageName, ClassTypeDef recordType, List<io.micronaut.inject.ast.PropertyElement> properties, List<io.micronaut.inject.ast.ParameterElement> parameters, boolean hasBuilder) Builds a wither interface for the given arguments.static void
weaveWithMethods
(ClassTypeDef recordType, RecordDef.RecordDefBuilder recordBuilder, List<io.micronaut.inject.ast.PropertyElement> properties, List<io.micronaut.inject.ast.ParameterElement> parameters, boolean hasBuilder) Add with methods to an existing record type being generated.
-
Constructor Details
-
WitherGenerator
public WitherGenerator()
-
-
Method Details
-
createWither
public static InterfaceDef.InterfaceDefBuilder createWither(String packageName, ClassTypeDef recordType, List<io.micronaut.inject.ast.PropertyElement> properties, List<io.micronaut.inject.ast.ParameterElement> parameters, boolean hasBuilder) Builds a wither interface for the given arguments.- Parameters:
packageName
- The package namerecordType
- The record typeproperties
- The propertiesparameters
- The parametershasBuilder
- Is there a builder- Returns:
- The interface
-
weaveWithMethods
public static void weaveWithMethods(ClassTypeDef recordType, RecordDef.RecordDefBuilder recordBuilder, List<io.micronaut.inject.ast.PropertyElement> properties, List<io.micronaut.inject.ast.ParameterElement> parameters, boolean hasBuilder) Add with methods to an existing record type being generated.- Parameters:
recordType
- The record typerecordBuilder
- The record builderproperties
- The propertiesparameters
- The parametershasBuilder
- Whether a builder is present
-