Class ResolvedWildcard
- java.lang.Object
-
- com.github.javaparser.resolution.types.ResolvedWildcard
-
- All Implemented Interfaces:
ResolvedType
public class ResolvedWildcard extends java.lang.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.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
ResolvedWildcard.BoundType
-
Field Summary
Fields Modifier and Type Field Description private ResolvedType
boundedType
private ResolvedWildcard.BoundType
type
static ResolvedWildcard
UNBOUNDED
-
Constructor Summary
Constructors Modifier Constructor Description private
ResolvedWildcard(ResolvedWildcard.BoundType type, ResolvedType boundedType)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description ResolvedWildcard
asWildcard()
java.lang.String
describe()
boolean
equals(java.lang.Object o)
ResolvedType
erasure()
static ResolvedWildcard
extendsBound(ResolvedType type)
ResolvedType
getBoundedType()
int
hashCode()
boolean
isAssignableBy(ResolvedType other)
This method checks if ThisType t = new OtherType() would compile.boolean
isBounded()
boolean
isExtends()
boolean
isLowerBounded()
boolean
isSuper()
boolean
isUpperBounded()
boolean
isWildcard()
boolean
mention(java.util.List<ResolvedTypeParameterDeclaration> typeParameters)
Does this type mention at all, directly or indirectly, the given type parameters?ResolvedType
replaceTypeVariables(ResolvedTypeParameterDeclaration tpToReplace, ResolvedType replaced, java.util.Map<ResolvedTypeParameterDeclaration,ResolvedType> inferredTypes)
Replace all variables referring to the given TypeParameter with the given value.ResolvedType
solveGenericTypes(Context context)
static ResolvedWildcard
superBound(ResolvedType type)
java.lang.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, asTypeParameter, asTypeVariable, asUnionType, isArray, isConstraint, isInferenceVariable, isNull, isNumericType, isPrimitive, isReference, isReferenceType, isTypeVariable, isUnionType, isVoid, replaceTypeVariables, toDescriptor
-
-
-
-
Field Detail
-
UNBOUNDED
public static ResolvedWildcard UNBOUNDED
-
type
private ResolvedWildcard.BoundType type
-
boundedType
private ResolvedType boundedType
-
-
Constructor Detail
-
ResolvedWildcard
private ResolvedWildcard(ResolvedWildcard.BoundType type, ResolvedType boundedType)
-
-
Method Detail
-
superBound
public static ResolvedWildcard superBound(ResolvedType type)
-
extendsBound
public static ResolvedWildcard extendsBound(ResolvedType type)
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
isWildcard
public boolean isWildcard()
- Specified by:
isWildcard
in interfaceResolvedType
-
asWildcard
public ResolvedWildcard asWildcard()
- Specified by:
asWildcard
in interfaceResolvedType
-
equals
public boolean equals(java.lang.Object o)
- Overrides:
equals
in classjava.lang.Object
-
hashCode
public int hashCode()
- Overrides:
hashCode
in classjava.lang.Object
-
describe
public java.lang.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, java.util.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(java.util.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
-
-