public final class PrimitiveType extends Type
equals(Object)
should be used.
A primitive is considered equal to another primitive if it specifies the same primitive enumeration value, and contains an equal set of annotation instances.
Modifier and Type | Class and Description |
---|---|
static class |
PrimitiveType.Primitive
Specifies the underlying Java primitive type for a
PrimitiveType |
Modifier and Type | Field and Description |
---|---|
static PrimitiveType |
BOOLEAN |
static PrimitiveType |
BYTE |
static PrimitiveType |
CHAR |
static PrimitiveType |
DOUBLE |
static PrimitiveType |
FLOAT |
static PrimitiveType |
INT |
static PrimitiveType |
LONG |
private PrimitiveType.Primitive |
primitive |
private static java.util.Map<java.lang.String,PrimitiveType> |
reverseMap |
static PrimitiveType |
SHORT |
EMPTY_ARRAY
Modifier | Constructor and Description |
---|---|
private |
PrimitiveType(PrimitiveType.Primitive primitive) |
private |
PrimitiveType(PrimitiveType.Primitive primitive,
AnnotationInstance[] annotations) |
Modifier and Type | Method and Description |
---|---|
PrimitiveType |
asPrimitiveType()
Casts this type to a
PrimitiveType and returns it if the kind is
Type.Kind.PRIMITIVE
Throws an exception otherwise. |
(package private) Type |
copyType(AnnotationInstance[] newAnnotations) |
(package private) static PrimitiveType |
decode(char c) |
(package private) static PrimitiveType |
decode(java.lang.String name) |
boolean |
equals(java.lang.Object o)
Compares this Type with another type, and returns true if they are equivalent.
|
(package private) static PrimitiveType |
fromOridinal(int ordinal) |
int |
hashCode()
Computes a hash code representing this type.
|
Type.Kind |
kind()
Returns the kind of Type this is.
|
PrimitiveType.Primitive |
primitive()
The type of primitive this primitive type represents
|
(package private) char |
toCode() |
addAnnotation, annotation, annotationArray, annotations, appendAnnotations, asArrayType, asClassType, asParameterizedType, asTypeVariable, asUnresolvedTypeVariable, asVoidType, asWildcardType, create, hasAnnotation, name, toString, toString
public static final PrimitiveType BYTE
public static final PrimitiveType CHAR
public static final PrimitiveType DOUBLE
public static final PrimitiveType FLOAT
public static final PrimitiveType INT
public static final PrimitiveType LONG
public static final PrimitiveType SHORT
public static final PrimitiveType BOOLEAN
private static final java.util.Map<java.lang.String,PrimitiveType> reverseMap
private final PrimitiveType.Primitive primitive
private PrimitiveType(PrimitiveType.Primitive primitive)
private PrimitiveType(PrimitiveType.Primitive primitive, AnnotationInstance[] annotations)
public PrimitiveType.Primitive primitive()
public PrimitiveType asPrimitiveType()
Type
PrimitiveType
and returns it if the kind is
Type.Kind.PRIMITIVE
Throws an exception otherwise.asPrimitiveType
in class Type
ClassType
public boolean equals(java.lang.Object o)
Type
Type copyType(AnnotationInstance[] newAnnotations)
public int hashCode()
Type
char toCode()
static PrimitiveType decode(java.lang.String name)
static PrimitiveType decode(char c)
static PrimitiveType fromOridinal(int ordinal)