Class ObjectDef

java.lang.Object
io.micronaut.sourcegen.model.ObjectDef
Direct Known Subclasses:
ClassDef, EnumDef, InterfaceDef, RecordDef

public abstract sealed class ObjectDef extends Object permits ClassDef, EnumDef, InterfaceDef, RecordDef
The abstract class representing a type: class, enum, interface or record.
Since:
1.0
Author:
Denis Stepanov
  • Field Details

  • Method Details

    • getMethods

      public final List<MethodDef> getMethods()
    • getProperties

      public final List<PropertyDef> getProperties()
    • getSuperinterfaces

      public final List<TypeDef> getSuperinterfaces()
    • getPackageName

      public final String getPackageName()
    • getSimpleName

      public final String getSimpleName()
    • getInnerTypes

      public final List<ObjectDef> getInnerTypes()
    • withClassName

      public abstract ObjectDef withClassName(ClassTypeDef.ClassName className)
      Creates a copy of this definition with a new class name.
      Parameters:
      className - The class name
      Returns:
      the copy of this object definition with a new class name
      Since:
      1.5
    • asTypeDef

      public ClassTypeDef asTypeDef()
      Get the type definition for this type.
      Returns:
      The type definition
    • getContextualType

      @NonNull public @NonNull TypeDef getContextualType(@NonNull @NonNull TypeDef typeDef)
      Get the actual contextual type.
      Parameters:
      typeDef - The type
      Returns:
      The contextual type or original type
      Since:
      1.5
    • getContextualType

      @NonNull public static @NonNull TypeDef getContextualType(@Nullable @Nullable ObjectDef objectDef, @NonNull @NonNull TypeDef typeDef)
      Get a contextual type (converts this or super type to appropriate one).
      Parameters:
      objectDef - The object def
      typeDef - The type def
      Returns:
      the contextual type or type def provider
      Since:
      1.4
    • getName

      public final String getName()
    • getModifiers

      public final Set<Modifier> getModifiers()
    • getModifiersArray

      public final Modifier[] getModifiersArray()
    • getAnnotations

      public final List<AnnotationDef> getAnnotations()
    • getJavadoc

      public List<String> getJavadoc()