Class InferenceVariable
java.lang.Object
com.github.javaparser.symbolsolver.resolution.typeinference.InferenceVariable
- All Implemented Interfaces:
ResolvedType
Are meta-variables for types - that is, they are special names that allow abstract reasoning about types.
To distinguish them from type variables, inference variables are represented with Greek letters, principally α.
See JLS 18
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate String
private ResolvedTypeParameterDeclaration
private static int
-
Constructor Summary
ConstructorsConstructorDescriptionInferenceVariable
(String name, ResolvedTypeParameterDeclaration typeParameterDeclaration) -
Method Summary
Modifier and TypeMethodDescriptiondescribe()
boolean
int
hashCode()
static List
<InferenceVariable> instantiate
(List<ResolvedTypeParameterDeclaration> typeParameterDeclarations) boolean
isAssignableBy
(ResolvedType other) This method checks if ThisType t = new OtherType() would compile.boolean
boolean
mention
(List<ResolvedTypeParameterDeclaration> typeParameters) Does this type mention at all, directly or indirectly, the given type parameters?toString()
static InferenceVariable
unnamed
(ResolvedTypeParameterDeclaration typeParameterDeclaration) 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, asTypeParameter, asTypeVariable, asUnionType, asWildcard, erasure, isArray, isConstraint, isNull, isNumericType, isPrimitive, isReference, isReferenceType, isTypeVariable, isUnionType, isVoid, isWildcard, replaceTypeVariables, replaceTypeVariables, solveGenericTypes, toDescriptor
-
Field Details
-
unnamedInstantiated
private static int unnamedInstantiated -
name
-
typeParameterDeclaration
-
-
Constructor Details
-
InferenceVariable
-
-
Method Details
-
instantiate
public static List<InferenceVariable> instantiate(List<ResolvedTypeParameterDeclaration> typeParameterDeclarations) -
unnamed
-
isInferenceVariable
public boolean isInferenceVariable()- Specified by:
isInferenceVariable
in interfaceResolvedType
-
describe
- Specified by:
describe
in interfaceResolvedType
-
equals
-
hashCode
public int hashCode() -
isAssignableBy
Description copied from interface:ResolvedType
This method checks if ThisType t = new OtherType() would compile.- Specified by:
isAssignableBy
in interfaceResolvedType
-
getTypeParameterDeclaration
-
toString
-
mention
Description copied from interface:ResolvedType
Does this type mention at all, directly or indirectly, the given type parameters?- Specified by:
mention
in interfaceResolvedType
-