Class ResolvedTypeVariable
- java.lang.Object
-
- com.github.javaparser.resolution.types.ResolvedTypeVariable
-
- All Implemented Interfaces:
ResolvedType
public class ResolvedTypeVariable extends Object implements 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 Constructor Description ResolvedTypeVariable(ResolvedTypeParameterDeclaration typeParameter)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ResolvedTypeParameterDeclarationasTypeParameter()ResolvedTypeVariableasTypeVariable()Stringdescribe()booleanequals(Object o)ResolvedTypeerasure()inthashCode()booleanisArray()booleanisAssignableBy(ResolvedType other)This method checks if ThisType t = new OtherType() would compile.booleanisReferenceType()Can this be seen as a ReferenceTypeUsage?booleanisTypeVariable()booleanmention(List<ResolvedTypeParameterDeclaration> typeParameters)Does this type mention at all, directly or indirectly, the given type parameters?StringqualifiedName()ResolvedTypereplaceTypeVariables(ResolvedTypeParameterDeclaration tpToBeReplaced, ResolvedType replaced, Map<ResolvedTypeParameterDeclaration,ResolvedType> inferredTypes)Replace all variables referring to the given TypeParameter with the given value.ResolvedTypesolveGenericTypes(Context context)StringtoDescriptor()StringtoString()-
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
-
-
-
-
Constructor Detail
-
ResolvedTypeVariable
public ResolvedTypeVariable(ResolvedTypeParameterDeclaration typeParameter)
-
-
Method Detail
-
qualifiedName
public String qualifiedName()
-
isArray
public boolean isArray()
- Specified by:
isArrayin 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: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
public String describe()
- Specified by:
describein interfaceResolvedType
-
asTypeParameter
public ResolvedTypeParameterDeclaration asTypeParameter()
- Specified by:
asTypeParameterin interfaceResolvedType
-
asTypeVariable
public ResolvedTypeVariable asTypeVariable()
- Specified by:
asTypeVariablein 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
-
mention
public boolean mention(List<ResolvedTypeParameterDeclaration> typeParameters)
Description copied from interface:ResolvedTypeDoes this type mention at all, directly or indirectly, the given type parameters?- Specified by:
mentionin interfaceResolvedType
-
erasure
public ResolvedType erasure()
- Specified by:
erasurein interfaceResolvedType
-
solveGenericTypes
public ResolvedType solveGenericTypes(Context context)
- Specified by:
solveGenericTypesin interfaceResolvedType
-
toDescriptor
public String toDescriptor()
- Specified by:
toDescriptorin interfaceResolvedType
-
-