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()booleanerasure()inthashCode()booleanisArray()booleanisAssignableBy(ResolvedType other) This method checks if ThisType t = new OtherType() would compile.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.solveGenericTypes(Context context) toString()Methods inherited from interface 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
-
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
- 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
-
solveGenericTypes
- Specified by:
solveGenericTypesin interfaceResolvedType
-
toDescriptor
- Specified by:
toDescriptorin interfaceResolvedType
-