public enum ClassType extends Enum<ClassType>
Class objects.| Enum Constant and Description |
|---|
ANNOTATION
The class is an annotation type, e.g.
|
ARRAY
The class is an array, such as
String[].class or int[].class. |
ENUM
The class represents an
enum, e.g. |
ENUM_ENTRY
The class is the synthetic class of an enum entry that anonymously extends the enum type.
|
INTERFACE
The class is an interface, such as
Collection. |
PRIMITIVE
The class is a primitive type such as
double.class, or void.class. |
PROXY_CLASS
The class is a proxy class dynamically generated at runtime, such as those used in reflection or
dynamic proxy mechanisms.
|
REGULAR_CLASS
The class is a "regular" Java class, which typically means it was declared with the
class or
record keyword. |
| Modifier and Type | Method and Description |
|---|---|
static ClassType |
valueOf(String name)
Returns the enum constant of this type with the specified name.
|
static ClassType[] |
values()
Returns an array containing the constants of this enum type, in
the order they are declared.
|
public static final ClassType ENUM
public static final ClassType ENUM_ENTRY
false for the Class.isEnum() method, it is assignable to the Enum type.
NumericShaper.Range.ETHIOPIC.getClass()public static final ClassType ANNOTATION
Override. Classes that manually extend
Annotation do not fall into this category.
Note that objects of annotation types have a corresponding proxy class; their class is categorized as
PROXY_CLASS. Example:
{@codepublic static final ClassType PRIMITIVE
double.class, or void.class.public static final ClassType ARRAY
String[].class or int[].class.ArrayClassPropertiespublic static final ClassType INTERFACE
Collection.public static final ClassType PROXY_CLASS
public static final ClassType REGULAR_CLASS
class or
record keyword. A class is considered a "regular class" by exclusion: it is a "regular class" if none of
the other types of this enum apply to it.
String
Note that nested classes and anonymous classes may also be considered "regular classes".
public static ClassType[] values()
for (ClassType c : ClassType.values()) System.out.println(c);
public static ClassType valueOf(String name)
name - the name of the enum constant to be returned.IllegalArgumentException - if this enum type has no constant with the specified nameNullPointerException - if the argument is nullCopyright © 2023. All rights reserved.