Class WitherGenerator

java.lang.Object
io.micronaut.sourcegen.generator.visitors.WitherGenerator

public class WitherGenerator extends Object
Provides methods for creating withers from other processors.
  • 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 name
      recordType - The record type
      properties - The properties
      parameters - The parameters
      hasBuilder - 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 type
      recordBuilder - The record builder
      properties - The properties
      parameters - The parameters
      hasBuilder - Whether a builder is present