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).
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiondescribe()
boolean
erasure()
int
hashCode()
boolean
isArray()
boolean
isAssignableBy
(ResolvedType other) This method checks if ThisType t = new OtherType() would compile.boolean
Can this be seen as a ReferenceTypeUsage? In other words: is this a reference to a class, an interface or an enum?boolean
boolean
mention
(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.solveGenericTypes
(Context context) toString()
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface com.github.javaparser.resolution.types.ResolvedType
arrayLevel, asArrayType, asConstraintType, asPrimitive, asReferenceType, asUnionType, asWildcard, isConstraint, isInferenceVariable, isNull, isNumericType, isPrimitive, isReference, isUnionType, isVoid, isWildcard, replaceTypeVariables
-
Field Details
-
typeParameter
-
-
Constructor Details
-
ResolvedTypeVariable
-
-
Method Details
-
toString
-
qualifiedName
-
equals
-
hashCode
public int hashCode() -
isArray
public boolean isArray()- Specified by:
isArray
in interfaceResolvedType
- Returns:
- true, if this type represent an array - otherwise false.
-
replaceTypeVariables
public ResolvedType replaceTypeVariables(ResolvedTypeParameterDeclaration tpToBeReplaced, ResolvedType replaced, Map<ResolvedTypeParameterDeclaration, ResolvedType> inferredTypes) Description copied from interface:ResolvedType
Replace 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:
replaceTypeVariables
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
- Specified by:
describe
in interfaceResolvedType
-
asTypeParameter
- Specified by:
asTypeParameter
in interfaceResolvedType
-
asTypeVariable
- Specified by:
asTypeVariable
in interfaceResolvedType
-
isTypeVariable
public boolean isTypeVariable()- Specified by:
isTypeVariable
in interfaceResolvedType
-
isAssignableBy
Description copied from interface:ResolvedType
This method checks if ThisType t = new OtherType() would compile.- Specified by:
isAssignableBy
in interfaceResolvedType
-
mention
Description copied from interface:ResolvedType
Does this type mention at all, directly or indirectly, the given type parameters?- Specified by:
mention
in interfaceResolvedType
-
erasure
- Specified by:
erasure
in interfaceResolvedType
-
solveGenericTypes
- Specified by:
solveGenericTypes
in interfaceResolvedType
-
toDescriptor
- Specified by:
toDescriptor
in interfaceResolvedType
-