Class ResolvedTypeVariable
java.lang.Object
com.github.javaparser.resolution.types.ResolvedTypeVariable
- All Implemented Interfaces:
ResolvedType
From JLS 4.4: A type variable is introduced by the declaration of a type parameter of a generic class,
interface, method, or constructor (§8.1.2, §9.1.2, §8.4.4, §8.8.4).
- Author:
- Federico Tomassetti
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiondescribe()booleanerasure()inthashCode()booleanisArray()booleanisAssignableBy(ResolvedType other)This method checks if ThisType t = new OtherType() would compile.booleanIs this a primitive type?booleanCan this be seen as a ReferenceTypeUsage? In other words: is this a reference to a class, an interface or an enum?booleanbooleanmention(List<ResolvedTypeParameterDeclaration> typeParameters)Does this type mention at all, directly or indirectly, the given type parameters?replaceTypeVariables(ResolvedTypeParameterDeclaration tpToBeReplaced, ResolvedType replaced, Map<ResolvedTypeParameterDeclaration,ResolvedType> inferredTypes)Replace all variables referring to the given TypeParameter with the given value.toString()Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface com.github.javaparser.resolution.types.ResolvedType
arrayLevel, asArrayType, asConstraintType, asPrimitive, asReferenceType, asUnionType, asWildcard, isConstraint, isInferenceVariable, isNull, isNumericType, isReference, isUnionType, isVoid, isWildcard, replaceTypeVariables
-
Constructor Details
-
ResolvedTypeVariable
-
-
Method Details
-
toString
-
qualifiedName
-
equals
-
hashCode
public int hashCode() -
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
-
replaceTypeVariables
public ResolvedType replaceTypeVariables(ResolvedTypeParameterDeclaration tpToBeReplaced, ResolvedType replaced, Map<ResolvedTypeParameterDeclaration,ResolvedType> inferredTypes)Description copied from interface:ResolvedTypeReplace all variables referring to the given TypeParameter with the given value. By replacing these values I could also infer some type equivalence. Those would be collected in the given map.- Specified by:
replaceTypeVariablesin 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
- Specified by:
describein interfaceResolvedType
-
asTypeParameter
- Specified by:
asTypeParameterin interfaceResolvedType
-
asTypeVariable
- Specified by:
asTypeVariablein interfaceResolvedType
-
isTypeVariable
public boolean isTypeVariable()- Specified by:
isTypeVariablein interfaceResolvedType
-
isAssignableBy
Description copied from interface:ResolvedTypeThis method checks if ThisType t = new OtherType() would compile.- Specified by:
isAssignableByin interfaceResolvedType
-
mention
Description copied from interface:ResolvedTypeDoes this type mention at all, directly or indirectly, the given type parameters?- Specified by:
mentionin interfaceResolvedType
-
erasure
- Specified by:
erasurein interfaceResolvedType
-