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

The abstract builder that is used for specific types: interfaces, classes, records or enums.
Since:
1.3
Author:
Andriy Dmytruk
  • Field Details

  • Constructor Details

    • ObjectDefBuilder

      protected ObjectDefBuilder(String name)
  • Method Details

    • addMethod

      @NonNull public final ThisType addMethod(@NonNull @NonNull MethodDef method)
      Add a method.
      Parameters:
      method - The method.
      Returns:
      The builder
    • addMethods

      @NonNull public final ThisType addMethods(@NonNull @NonNull Collection<MethodDef> methods)
      Add methods.
      Parameters:
      methods - The method.s
      Returns:
      The builder
    • addProperty

      @NonNull public final ThisType addProperty(@NonNull @NonNull PropertyDef property)
      Add a property.
      Parameters:
      property - The property.
      Returns:
      The builder
    • addSuperinterface

      @NonNull public final ThisType addSuperinterface(@NonNull @NonNull TypeDef superinterface)
      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

      @NonNull public final ThisType addInnerType(@NonNull @NonNull ObjectDef innerDef)
      Add an inner type.
      Parameters:
      innerDef - The inner definition.
      Returns:
      The builder
    • addInnerType

      @NonNull public final ThisType addInnerType(@NonNull @NonNull Collection<ObjectDef> innerDefs)
      Add an inner types.
      Parameters:
      innerDefs - The inner definitions.
      Returns:
      The builder