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 ResolvedPrimitiveTypeasPrimitive()ResolvedPrimitiveTypebnp(ResolvedPrimitiveType other)static Optional<ResolvedType>byBoxTypeQName(String qName)static ResolvedTypebyName(String name)Stringdescribe()ClassgetBoxTypeClass()StringgetBoxTypeQName()static ResolvedPrimitiveType[]getNumericPrimitiveTypes()booleanin(ResolvedPrimitiveType... types)booleanisArray()booleanisAssignableBy(ResolvedType other)This method checks if ThisType t = new OtherType() would compile.booleanisBoolean()Is this a boolean type?static booleanisBoxType(ResolvedType type)booleanisNumeric()booleanisPrimitive()Is this a primitive type?booleanisReferenceType()Can this be seen as a ReferenceTypeUsage?booleanisTypeVariable()StringtoDescriptor()StringtoString()static ResolvedTypeunp(ResolvedType type)static ResolvedPrimitiveTypevalueOf(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, erasure, isConstraint, isInferenceVariable, isNull, isNumericType, isReference, isUnionType, isVoid, isWildcard, mention, replaceTypeVariables, replaceTypeVariables, solveGenericTypes
-
-
-
-
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)
-
isBoxType
public static boolean isBoxType(ResolvedType type)
-
byBoxTypeQName
public static Optional<ResolvedType> byBoxTypeQName(String qName)
-
getNumericPrimitiveTypes
public static ResolvedPrimitiveType[] getNumericPrimitiveTypes()
-
toString
public String toString()
- Overrides:
toStringin classEnum<ResolvedPrimitiveType>
-
asPrimitive
public ResolvedPrimitiveType asPrimitive()
- Specified by:
asPrimitivein interfaceResolvedType
-
isArray
public boolean isArray()
- Specified by:
isArrayin interfaceResolvedType- Returns:
- true, if this type represent an array - otherwise false.
-
isPrimitive
public boolean isPrimitive()
Description copied from interface:ResolvedTypeIs this a primitive type?- Specified by:
isPrimitivein interfaceResolvedType
-
isReferenceType
public boolean isReferenceType()
Description copied from interface:ResolvedTypeCan this be seen as a ReferenceTypeUsage? In other words: is this a reference to a class, an interface or an enum?- Specified by:
isReferenceTypein interfaceResolvedType
-
describe
public String describe()
- Specified by:
describein interfaceResolvedType
-
isTypeVariable
public boolean isTypeVariable()
- Specified by:
isTypeVariablein interfaceResolvedType
-
isAssignableBy
public boolean isAssignableBy(ResolvedType other)
Description copied from interface:ResolvedTypeThis method checks if ThisType t = new OtherType() would compile.- Specified by:
isAssignableByin interfaceResolvedType
-
getBoxTypeQName
public String getBoxTypeQName()
-
getBoxTypeClass
public Class getBoxTypeClass()
-
isNumeric
public boolean isNumeric()
-
isBoolean
public boolean isBoolean()
Is this a boolean type?
-
bnp
public ResolvedPrimitiveType bnp(ResolvedPrimitiveType other)
-
unp
public static ResolvedType unp(ResolvedType type)
-
in
public boolean in(ResolvedPrimitiveType... types)
-
toDescriptor
public String toDescriptor()
- Specified by:
toDescriptorin interfaceResolvedType
-
-