Package org.jboss.jandex
Class PrimitiveType
java.lang.Object
org.jboss.jandex.Type
org.jboss.jandex.PrimitiveType
Represents a primitive Java type. While a set of constants is provided for easy of use,
instance equality should not be used to compare to them. Instead
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.
- Since:
- 2.0
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enum
Specifies the underlying Java primitive type for aPrimitiveType
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final PrimitiveType
static final PrimitiveType
static final PrimitiveType
static final PrimitiveType
static final PrimitiveType
static final PrimitiveType
static final PrimitiveType
private final PrimitiveType.Primitive
private static final Map
<String, PrimitiveType> static final PrimitiveType
Fields inherited from class org.jboss.jandex.Type
EMPTY_ARRAY
-
Constructor Summary
ConstructorsModifierConstructorDescriptionprivate
PrimitiveType
(PrimitiveType.Primitive primitive) private
PrimitiveType
(PrimitiveType.Primitive primitive, AnnotationInstance[] annotations) -
Method Summary
Modifier and TypeMethodDescriptionCasts this type to aPrimitiveType
and returns it if the kind isType.Kind.PRIMITIVE
Throws an exception otherwise.(package private) Type
copyType
(AnnotationInstance[] newAnnotations) (package private) static PrimitiveType
decode
(char c) (package private) static PrimitiveType
boolean
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.kind()
Returns the kind of Type this is.The type of primitive this primitive type represents(package private) char
toCode()
Methods inherited from class org.jboss.jandex.Type
addAnnotation, annotation, annotationArray, annotations, appendAnnotations, asArrayType, asClassType, asParameterizedType, asTypeVariable, asUnresolvedTypeVariable, asVoidType, asWildcardType, create, hasAnnotation, name, toString, toString
-
Field Details
-
BYTE
-
CHAR
-
DOUBLE
-
FLOAT
-
INT
-
LONG
-
SHORT
-
BOOLEAN
-
reverseMap
-
primitive
-
-
Constructor Details
-
PrimitiveType
-
PrimitiveType
-
-
Method Details
-
kind
Description copied from class:Type
Returns the kind of Type this is. -
primitive
The type of primitive this primitive type represents- Returns:
- the primitive
-
asPrimitiveType
Description copied from class:Type
Casts this type to aPrimitiveType
and returns it if the kind isType.Kind.PRIMITIVE
Throws an exception otherwise.- Overrides:
asPrimitiveType
in classType
- Returns:
- a
ClassType
-
equals
Description copied from class:Type
Compares this Type with another type, and returns true if they are equivalent. A type is equivalent to another type if it is the same kind, and all of its fields are equal. This includes annotations, which must be equal as well. -
copyType
-
hashCode
public int hashCode()Description copied from class:Type
Computes a hash code representing this type. -
toCode
char toCode() -
decode
-
decode
-
fromOridinal
-