Package org.jboss.jandex
Class PrimitiveType
java.lang.Object
org.jboss.jandex.Type
org.jboss.jandex.PrimitiveType
- All Implemented Interfaces:
Descriptor
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.
- Author:
- Jason T. Greene
- Since:
- 2.0
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enumSpecifies the underlying Java primitive type for aPrimitiveType -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final PrimitiveTypestatic final PrimitiveTypestatic final PrimitiveTypestatic final PrimitiveTypestatic final PrimitiveTypestatic final PrimitiveTypestatic final PrimitiveTypestatic final PrimitiveTypeFields inherited from class org.jboss.jandex.Type
EMPTY_ARRAYFields inherited from interface org.jboss.jandex.Descriptor
NO_SUBSTITUTION -
Method Summary
Modifier and TypeMethodDescriptionCasts this type to aPrimitiveTypeand returns it if the kind isType.Kind.PRIMITIVE.booleanCompares thisTypewith another type.inthashCode()Computes a hash code representing this type.kind()Returns the kind of Type this is.The type of primitive this primitive type representsMethods inherited from class org.jboss.jandex.Type
annotation, annotations, annotationsWithRepeatable, asArrayType, asClassType, asParameterizedType, asTypeVariable, asTypeVariableReference, asUnresolvedTypeVariable, asVoidType, asWildcardType, create, createWithAnnotations, descriptor, hasAnnotation, name, toStringMethods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface org.jboss.jandex.Descriptor
descriptor
-
Field Details
-
BYTE
-
CHAR
-
DOUBLE
-
FLOAT
-
INT
-
LONG
-
SHORT
-
BOOLEAN
-
-
Method Details
-
kind
Description copied from class:TypeReturns the kind of Type this is. -
primitive
The type of primitive this primitive type represents- Returns:
- the primitive
-
asPrimitiveType
Description copied from class:TypeCasts this type to aPrimitiveTypeand returns it if the kind isType.Kind.PRIMITIVE. Throws an exception otherwise.- Overrides:
asPrimitiveTypein classType- Returns:
- a
PrimitiveType
-
equals
Description copied from class:TypeCompares thisTypewith another type. A type is equal to another type if it is of the same kind, and all of their fields are equal. This includes annotations, which must be equal as well. -
hashCode
public int hashCode()Description copied from class:TypeComputes a hash code representing this type.
-