At the same time, it is possible to obtain the set of constructors, methods and fields declared in this class, as well as the set of record components if this class is a record. It is also possible to obtain the package this class is declared in.
| Modifier and Type | Method and Description |
|---|---|
| public default ClassInfo | asClass()
Overrides default jakarta. Returns this declaration as a class. |
| public Collection | Returns: immutable collection of constructors, nevernullReturns a collection of constructors declared or implicitly declared in this class. |
| public Collection | |
| public boolean | |
| public boolean | Returns: whether this class is an annotationReturns whether this class is an annotation. |
| public boolean | |
| public boolean | |
| public boolean | |
| public boolean | Returns: whether this class is a plain classReturns whether this class is a plain class. |
| public boolean | |
| public default DeclarationInfo. | kind()
Implements jakarta. Returns the kind of this declaration. |
| public Collection | |
| public int | |
| public String | Returns: binary name of this class, nevernullReturns the binary name of this class, as defined by The Java™ Language Specification;
in other words, the class name as returned by |
| public PackageInfo | Returns: this class's package, ornull if this class is in an unnamed packageReturns the package this class is part of. |
| public Collection | Returns: immutable collection of record components, nevernulReturns a collection of record components declared in this class. |
| public String | Returns: simple name of this class, nevernullReturns the simple name of this class, as defined by The Java™ Language Specification;
in other words, the class name as returned by |
| public Type | Returns: the direct superclass type of this class, ornull if there's no superclassReturns the direct superclass type of this class. |
| public ClassInfo | Returns: the direct superclass of this class, ornull if there's no superclassReturns the direct superclass of this class. |
| public List | Returns: immutable list of direct superinterface types of this class, nevernullReturns a list of direct superinterface types of this class. |
| public List | Returns: immutable list of direct superinterfaces of this class, nevernullReturns a list of direct superinterfaces of this class. |
| public List | Returns: immutable list of this class's type parameters, nevernullReturns a list of type parameters declared on this class. |
| asClass | back to summary |
|---|---|
| public default ClassInfo asClass() Overrides default jakarta. Doc from jakarta. Returns this declaration as a class. | |
| constructors | back to summary |
|---|---|
| public Collection Returns a collection of constructors declared or implicitly declared in this class. Constructors declared in direct or indirect superclasses are not included. If this class is an interface or an annotation, returns an empty collection.
| |
| fields | back to summary |
|---|---|
| public Collection Returns a collection of fields declared or implicitly declared
in this class and all its superclasses up to and excluding
If the collection of fields described above contains multiple fields with the same name,
all such fields are returned. Iteration order of the resulting collection is not defined and does not have to correspond to the inheritance hierarchy of this class.
| |
| isAbstract | back to summary |
|---|---|
| public boolean isAbstract() Returns whether this class is abstract.
A plain class is abstract if declared
| |
| isAnnotation | back to summary |
|---|---|
| public boolean isAnnotation() Returns whether this class is an annotation.
| |
| isEnum | back to summary |
|---|---|
| public boolean isEnum() Returns whether this class is an enum.
| |
| isFinal | back to summary |
|---|---|
| public boolean isFinal() Returns whether this class is
| |
| isInterface | back to summary |
|---|---|
| public boolean isInterface() Returns whether this class is an interface.
If this class is an annotation, returns
| |
| isPlainClass | back to summary |
|---|---|
| public boolean isPlainClass() Returns whether this class is a plain class. That is, not an interface, not an enum, not an annotation, and not a record.
| |
| isRecord | back to summary |
|---|---|
| public boolean isRecord() Returns whether this class is a record.
| |
| kind | back to summary |
|---|---|
| public default DeclarationInfo. Implements jakarta. Doc from jakarta. Returns the kind of this declaration.
| |
| methods | back to summary |
|---|---|
| public Collection Returns a collection of methods declared or implicitly declared
in this class and all its superclasses up to and excluding
If the collection of methods described above contains multiple methods with the same signature,
all such methods are returned. Iteration order of the resulting collection is not defined and does not have to correspond to the inheritance hierarchy of this class.
| |
| modifiers | back to summary |
|---|---|
| public int modifiers() Returns the modifiers of this class as an
| |
| name | back to summary |
|---|---|
| public String name() Returns the binary name of this class, as defined by The Java™ Language Specification;
in other words, the class name as returned by
| |
| packageInfo | back to summary |
|---|---|
| public PackageInfo packageInfo() Returns the package this class is part of.
Returns
| |
| recordComponents | back to summary |
|---|---|
| public Collection Returns a collection of record components declared in this class. If this class is not a record, returns an empty collection.
| |
| simpleName | back to summary |
|---|---|
| public String simpleName() Returns the simple name of this class, as defined by The Java™ Language Specification;
in other words, the class name as returned by
| |
| superClass | back to summary |
|---|---|
| public Type superClass() Returns the direct superclass type of this class. Returns
| |
| superClassDeclaration | back to summary |
|---|---|
| public ClassInfo superClassDeclaration() Returns the direct superclass of this class. Returns
| |
| superInterfaces | back to summary |
|---|---|
| public List Returns a list of direct superinterface types of this class. Returns an empty list if this class has no direct superinterface. | |
| superInterfacesDeclarations | back to summary |
|---|---|
| public List Returns a list of direct superinterfaces of this class. Returns an empty list if this class has no direct superinterface. | |
| typeParameters | back to summary |
|---|---|
| public List Returns a list of type parameters declared on this class. Returns an empty list if this class is not generic and so does not declare type parameters.
| |