public class WildcardType extends Type
Modifier and Type | Field and Description |
---|---|
private Type |
bound |
private int |
hash |
private boolean |
isExtends |
private static Type |
OBJECT |
EMPTY_ARRAY
Constructor and Description |
---|
WildcardType(Type bound,
boolean isExtends) |
WildcardType(Type bound,
boolean isExtends,
AnnotationInstance[] annotations) |
Modifier and Type | Method and Description |
---|---|
WildcardType |
asWildcardType()
Casts this type to a
WildcardType and returns it if the kind is
Type.Kind.WILDCARD_TYPE
Throws an exception otherwise. |
(package private) Type |
bound() |
(package private) Type |
copyType(AnnotationInstance[] newAnnotations) |
(package private) Type |
copyType(Type bound) |
static WildcardType |
create(Type bound,
boolean isExtends)
Create a new mock instance of WildcardType.
|
boolean |
equals(java.lang.Object o)
Compares this Type with another type, and returns true if they are equivalent.
|
Type |
extendsBound()
Returns the extends (upper) bound of this wildcard.
|
int |
hashCode()
Computes a hash code representing this type.
|
(package private) boolean |
isExtends() |
Type.Kind |
kind()
Returns the kind of Type this is.
|
Type |
superBound()
Returns the super (lower) bound of this wildcard.
|
java.lang.String |
toString()
Returns a string representation for this type.
|
addAnnotation, annotation, annotationArray, annotations, appendAnnotations, asArrayType, asClassType, asParameterizedType, asPrimitiveType, asTypeVariable, asUnresolvedTypeVariable, asVoidType, create, hasAnnotation, name, toString
private static Type OBJECT
private final boolean isExtends
private final Type bound
private int hash
WildcardType(Type bound, boolean isExtends)
WildcardType(Type bound, boolean isExtends, AnnotationInstance[] annotations)
public static WildcardType create(Type bound, boolean isExtends)
bound
- the bound (lower or upper)isExtends
- true if lower, false if upper (super)public Type extendsBound()
java.lang.Object
public Type superBound()
Type bound()
boolean isExtends()
public WildcardType asWildcardType()
Type
WildcardType
and returns it if the kind is
Type.Kind.WILDCARD_TYPE
Throws an exception otherwise.asWildcardType
in class Type
ClassType
public java.lang.String toString()
Type
Type copyType(AnnotationInstance[] newAnnotations)
public boolean equals(java.lang.Object o)
Type