Enum ResolvedPrimitiveType
- java.lang.Object
-
- java.lang.Enum<ResolvedPrimitiveType>
-
- com.github.javaparser.resolution.types.ResolvedPrimitiveType
-
- All Implemented Interfaces:
ResolvedType
,Serializable
,Comparable<ResolvedPrimitiveType>
public enum ResolvedPrimitiveType extends Enum<ResolvedPrimitiveType> implements ResolvedType
- Author:
- Federico Tomassetti
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description ResolvedPrimitiveType
asPrimitive()
static ResolvedType
byName(String name)
String
describe()
String
getBoxTypeQName()
boolean
isArray()
Does this type represent an array?boolean
isAssignableBy(ResolvedType other)
This method checks if ThisType t = new OtherType() would compile.boolean
isNumeric()
boolean
isPrimitive()
Is this a primitive type?boolean
isReferenceType()
Can this be seen as a ReferenceTypeUsage? In other words: is this a reference to a class, an interface or an enum?boolean
isTypeVariable()
String
toString()
static ResolvedPrimitiveType
valueOf(String name)
Returns the enum constant of this type with the specified name.static ResolvedPrimitiveType[]
values()
Returns an array containing the constants of this enum type, in the order they are declared.-
Methods inherited from class java.lang.Enum
clone, compareTo, equals, finalize, getDeclaringClass, hashCode, name, ordinal, valueOf
-
Methods inherited from interface com.github.javaparser.resolution.types.ResolvedType
arrayLevel, asArrayType, asConstraintType, asReferenceType, asTypeParameter, asTypeVariable, asUnionType, asWildcard, isConstraint, isNull, isReference, isUnionType, isVoid, isWildcard, mention, replaceTypeVariables, replaceTypeVariables
-
-
-
-
Enum Constant Detail
-
BYTE
public static final ResolvedPrimitiveType BYTE
-
SHORT
public static final ResolvedPrimitiveType SHORT
-
CHAR
public static final ResolvedPrimitiveType CHAR
-
INT
public static final ResolvedPrimitiveType INT
-
LONG
public static final ResolvedPrimitiveType LONG
-
BOOLEAN
public static final ResolvedPrimitiveType BOOLEAN
-
FLOAT
public static final ResolvedPrimitiveType FLOAT
-
DOUBLE
public static final ResolvedPrimitiveType DOUBLE
-
-
Method Detail
-
values
public static ResolvedPrimitiveType[] values()
Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:for (ResolvedPrimitiveType c : ResolvedPrimitiveType.values()) System.out.println(c);
- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
public static ResolvedPrimitiveType valueOf(String name)
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)- Parameters:
name
- the name of the enum constant to be returned.- Returns:
- the enum constant with the specified name
- Throws:
IllegalArgumentException
- if this enum type has no constant with the specified nameNullPointerException
- if the argument is null
-
byName
public static ResolvedType byName(String name)
-
toString
public String toString()
- Overrides:
toString
in classEnum<ResolvedPrimitiveType>
-
asPrimitive
public ResolvedPrimitiveType asPrimitive()
- Specified by:
asPrimitive
in interfaceResolvedType
-
isArray
public boolean isArray()
Description copied from interface:ResolvedType
Does this type represent an array?- Specified by:
isArray
in interfaceResolvedType
-
isPrimitive
public boolean isPrimitive()
Description copied from interface:ResolvedType
Is this a primitive type?- Specified by:
isPrimitive
in interfaceResolvedType
-
isReferenceType
public boolean isReferenceType()
Description copied from interface:ResolvedType
Can this be seen as a ReferenceTypeUsage? In other words: is this a reference to a class, an interface or an enum?- Specified by:
isReferenceType
in interfaceResolvedType
-
describe
public String describe()
- Specified by:
describe
in interfaceResolvedType
-
isTypeVariable
public boolean isTypeVariable()
- Specified by:
isTypeVariable
in interfaceResolvedType
-
isAssignableBy
public boolean isAssignableBy(ResolvedType other)
Description copied from interface:ResolvedType
This method checks if ThisType t = new OtherType() would compile.- Specified by:
isAssignableBy
in interfaceResolvedType
-
getBoxTypeQName
public String getBoxTypeQName()
-
isNumeric
public boolean isNumeric()
-
-