Serializable
, Comparable<TypeKind>
, Constable
public enum TypeKind extends Enum<TypeKind>
Note that it is possible additional type kinds will be added to accommodate new, currently unknown, language structures added to future versions of the Java programming language.
Enum.EnumDesc<E extends Enum<E>>
Enum Constant | Description |
---|---|
ARRAY |
An array type. |
BOOLEAN |
The primitive type boolean . |
BYTE |
The primitive type byte . |
CHAR |
The primitive type char . |
DECLARED |
A class or interface type. |
DOUBLE |
The primitive type double . |
ERROR |
A class or interface type that could not be resolved. |
EXECUTABLE |
A method, constructor, or initializer. |
FLOAT |
The primitive type float . |
INT |
The primitive type int . |
INTERSECTION |
An intersection type. |
LONG |
The primitive type long . |
MODULE |
A pseudo-type corresponding to a module element. |
NONE |
A pseudo-type used where no actual type is appropriate. |
NULL |
The null type. |
OTHER |
An implementation-reserved type. |
PACKAGE |
A pseudo-type corresponding to a package element. |
SHORT |
The primitive type short . |
TYPEVAR |
A type variable. |
UNION |
A union type. |
VOID |
The pseudo-type corresponding to the keyword void . |
WILDCARD |
A wildcard type argument. |
Modifier and Type | Method | Description |
---|---|---|
boolean |
isPrimitive() |
Returns true if this kind corresponds to a primitive type and false otherwise. |
static TypeKind |
valueOf |
Returns the enum constant of this class with the specified name. |
static TypeKind[] |
values() |
Returns an array containing the constants of this enum class, in the order they are declared. |
public static final TypeKind BOOLEAN
boolean
.public static final TypeKind BYTE
byte
.public static final TypeKind SHORT
short
.public static final TypeKind INT
int
.public static final TypeKind LONG
long
.public static final TypeKind CHAR
char
.public static final TypeKind FLOAT
float
.public static final TypeKind DOUBLE
double
.public static final TypeKind VOID
void
.public static final TypeKind NONE
public static final TypeKind NULL
public static final TypeKind ARRAY
public static final TypeKind DECLARED
public static final TypeKind ERROR
public static final TypeKind TYPEVAR
public static final TypeKind WILDCARD
public static final TypeKind PACKAGE
public static final TypeKind EXECUTABLE
public static final TypeKind OTHER
public static final TypeKind UNION
public static final TypeKind INTERSECTION
public static final TypeKind MODULE
public static TypeKind[] values()
public static TypeKind valueOf(String name)
name
- the name of the enum constant to be returned.IllegalArgumentException
- if this enum class has no constant with the specified nameNullPointerException
- if the argument is nullpublic boolean isPrimitive()
true
if this kind corresponds to a primitive type and false
otherwise.true
if this kind corresponds to a primitive type and false
otherwise
© 1993, 2023, Oracle and/or its affiliates. All rights reserved.
Documentation extracted from Debian's OpenJDK Development Kit package.
Licensed under the GNU General Public License, version 2, with the Classpath Exception.
Various third party code in OpenJDK is licensed under different licenses (see Debian package).
Java and OpenJDK are trademarks or registered trademarks of Oracle and/or its affiliates.
https://docs.oracle.com/en/java/javase/21/docs/api/java.compiler/javax/lang/model/type/TypeKind.html