Package io.micronaut.sourcegen.model
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 Summary
Modifier and TypeFieldDescriptionprotected final List<AnnotationDef>
protected final ClassTypeDef.ClassName
protected final String
protected final List<PropertyDef>
-
Method Summary
Modifier and TypeMethodDescriptionGet the type definition for this type.final List<AnnotationDef>
@NonNull TypeDef
getContextualType
(@NonNull TypeDef typeDef) Get the actual contextual type.static @NonNull TypeDef
getContextualType
(@Nullable ObjectDef objectDef, @NonNull TypeDef typeDef) Get a contextual type (converts this or super type to appropriate one).final Modifier[]
final String
getName()
final String
final List<PropertyDef>
final String
abstract ObjectDef
withClassName
(ClassTypeDef.ClassName className) Creates a copy of this definition with a new class name.
-
Field Details
-
className
-
methods
-
properties
-
superinterfaces
-
innerTypes
-
name
-
modifiers
-
annotations
-
javadoc
-
-
Method Details
-
getMethods
-
getProperties
-
getSuperinterfaces
-
getPackageName
-
getSimpleName
-
getInnerTypes
-
withClassName
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
Get the type definition for this type.- Returns:
- The type definition
-
getContextualType
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 deftypeDef
- The type def- Returns:
- the contextual type or type def provider
- Since:
- 1.4
-
getName
-
getModifiers
-
getModifiersArray
-
getAnnotations
-
getJavadoc
-