Class ResolvedWildcard
- java.lang.Object
-
- com.github.javaparser.resolution.types.ResolvedWildcard
-
- All Implemented Interfaces:
ResolvedType
public class ResolvedWildcard extends Object implements ResolvedType
A wildcard can be: - unbounded (?) - have a lower bound (? super Number) - have an upper bound (? extends Number) It is not possible to have both a lower and an upper bound at the same time.- Author:
- Federico Tomassetti
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
ResolvedWildcard.BoundType
-
Field Summary
Fields Modifier and Type Field Description static ResolvedWildcard
UNBOUNDED
-
Method Summary
-
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, isArray, isConstraint, isInferenceVariable, isNull, isNumericType, isPrimitive, isReference, isReferenceType, isTypeVariable, isUnionType, isVoid, replaceTypeVariables, toDescriptor
-
-
-
-
Field Detail
-
UNBOUNDED
public static ResolvedWildcard UNBOUNDED
-
-
Method Detail
-
superBound
public static ResolvedWildcard superBound(ResolvedType type)
-
extendsBound
public static ResolvedWildcard extendsBound(ResolvedType type)
-
isWildcard
public boolean isWildcard()
- Specified by:
isWildcard
in interfaceResolvedType
-
asWildcard
public ResolvedWildcard asWildcard()
- Specified by:
asWildcard
in interfaceResolvedType
-
describe
public String describe()
- Specified by:
describe
in interfaceResolvedType
-
isSuper
public boolean isSuper()
-
isExtends
public boolean isExtends()
-
isBounded
public boolean isBounded()
-
getBoundedType
public ResolvedType getBoundedType()
-
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
-
replaceTypeVariables
public ResolvedType replaceTypeVariables(ResolvedTypeParameterDeclaration tpToReplace, 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
-
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
-
isUpperBounded
public boolean isUpperBounded()
-
isLowerBounded
public boolean isLowerBounded()
-
solveGenericTypes
public ResolvedType solveGenericTypes(Context context)
- Specified by:
solveGenericTypes
in interfaceResolvedType
-
erasure
public ResolvedType erasure()
- Specified by:
erasure
in interfaceResolvedType
-
-