-
- All Superinterfaces:
AnnotationTarget
,Type
public interface PrimitiveType extends Type
Primitive types are:- boolean
- byte
- short
- int
- long
- float
- double
- char
- Since:
- 4.0
-
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static class
PrimitiveType.PrimitiveKind
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description default PrimitiveType
asPrimitive()
Returns this type as a primitive type.default boolean
isBoolean()
Returns whether this primitive type isboolean
.default boolean
isByte()
Returns whether this primitive type isbyte
.default boolean
isChar()
Returns whether this primitive type ischar
.default boolean
isDouble()
Returns whether this primitive type isdouble
.default boolean
isFloat()
Returns whether this primitive type isfloat
.default boolean
isInt()
Returns whether this primitive type isint
.default boolean
isLong()
Returns whether this primitive type islong
.default boolean
isShort()
Returns whether this primitive type isshort
.default Type.Kind
kind()
Returns the kind of this type.java.lang.String
name()
Returns the name of this primitive type.PrimitiveType.PrimitiveKind
primitiveKind()
Returns the kind of this primitive type.-
Methods inherited from interface jakarta.enterprise.lang.model.AnnotationTarget
annotation, annotations, annotations, hasAnnotation, hasAnnotation, repeatableAnnotation
-
Methods inherited from interface jakarta.enterprise.lang.model.types.Type
asArray, asClass, asDeclaration, asParameterizedType, asType, asTypeVariable, asVoid, asWildcardType, isArray, isClass, isDeclaration, isParameterizedType, isPrimitive, isType, isTypeVariable, isVoid, isWildcardType
-
-
-
-
Method Detail
-
name
java.lang.String name()
Returns the name of this primitive type.- Returns:
- the name of this primitive type
-
primitiveKind
PrimitiveType.PrimitiveKind primitiveKind()
Returns the kind of this primitive type.- Returns:
- the kind of this primitive type
-
isBoolean
default boolean isBoolean()
Returns whether this primitive type isboolean
.- Returns:
- whether this primitive type is
boolean
-
isByte
default boolean isByte()
Returns whether this primitive type isbyte
.- Returns:
- whether this primitive type is
byte
-
isShort
default boolean isShort()
Returns whether this primitive type isshort
.- Returns:
- whether this primitive type is
short
-
isInt
default boolean isInt()
Returns whether this primitive type isint
.- Returns:
- whether this primitive type is
int
-
isLong
default boolean isLong()
Returns whether this primitive type islong
.- Returns:
- whether this primitive type is
long
-
isFloat
default boolean isFloat()
Returns whether this primitive type isfloat
.- Returns:
- whether this primitive type is
float
-
isDouble
default boolean isDouble()
Returns whether this primitive type isdouble
.- Returns:
- whether this primitive type is
double
-
isChar
default boolean isChar()
Returns whether this primitive type ischar
.- Returns:
- whether this primitive type is
char
-
kind
default Type.Kind kind()
Description copied from interface:Type
Returns the kind of this type.
-
asPrimitive
default PrimitiveType asPrimitive()
Description copied from interface:Type
Returns this type as a primitive type.- Specified by:
asPrimitive
in interfaceType
- Returns:
- this primitive type, never
null
-
-