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 ResolvedTypeParameterDeclaration
asTypeParameter()
ResolvedTypeVariable
asTypeVariable()
String
describe()
boolean
equals(Object o)
int
hashCode()
boolean
isArray()
Does this type represent an array?boolean
isAssignableBy(ResolvedType other)
This method checks if ThisType t = new OtherType() would compile.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()
boolean
mention(List<ResolvedTypeParameterDeclaration> typeParameters)
Does this type mention at all, directly or indirectly, the given type parameters?String
qualifiedName()
ResolvedType
replaceTypeVariables(ResolvedTypeParameterDeclaration tpToBeReplaced, ResolvedType replaced, Map<ResolvedTypeParameterDeclaration,ResolvedType> inferredTypes)
Replace all variables referring to the given TypeParameter with the given value.String
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, isNull, isReference, isUnionType, isVoid, isWildcard, replaceTypeVariables
-
-
-
-
Constructor Detail
-
ResolvedTypeVariable
public ResolvedTypeVariable(ResolvedTypeParameterDeclaration typeParameter)
-
-
Method Detail
-
qualifiedName
public String qualifiedName()
-
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
-
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
public String describe()
- Specified by:
describe
in interfaceResolvedType
-
asTypeParameter
public ResolvedTypeParameterDeclaration asTypeParameter()
- Specified by:
asTypeParameter
in interfaceResolvedType
-
asTypeVariable
public ResolvedTypeVariable asTypeVariable()
- Specified by:
asTypeVariable
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
-
mention
public boolean mention(List<ResolvedTypeParameterDeclaration> typeParameters)
Description copied from interface:ResolvedType
Does this type mention at all, directly or indirectly, the given type parameters?- Specified by:
mention
in interfaceResolvedType
-
-