Package org.jboss.jandex
Class WildcardType
java.lang.Object
org.jboss.jandex.Type
org.jboss.jandex.WildcardType
Represents a generic wildcard. A generic wildcard can have either an upper (extends)
or a lower (super) bound. A wildcard declared without a bound ("?") has a default extends bound
of "java.lang.Object".
- Since:
- 2.0
-
Nested Class Summary
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final Type
private int
private final boolean
private static Type
Fields inherited from class org.jboss.jandex.Type
EMPTY_ARRAY
-
Constructor Summary
ConstructorsConstructorDescriptionWildcardType
(Type bound, boolean isExtends) WildcardType
(Type bound, boolean isExtends, AnnotationInstance[] annotations) -
Method Summary
Modifier and TypeMethodDescriptionCasts this type to aWildcardType
and returns it if the kind isType.Kind.WILDCARD_TYPE
Throws an exception otherwise.(package private) Type
bound()
(package private) Type
copyType
(AnnotationInstance[] newAnnotations) (package private) Type
static WildcardType
Create a new mock instance of WildcardType.boolean
Compares this Type with another type, and returns true if they are equivalent.Returns the extends (upper) bound of this wildcard.int
hashCode()
Computes a hash code representing this type.(package private) boolean
kind()
Returns the kind of Type this is.Returns the super (lower) bound of this wildcard.toString()
Returns a string representation for this type.Methods inherited from class org.jboss.jandex.Type
addAnnotation, annotation, annotationArray, annotations, appendAnnotations, asArrayType, asClassType, asParameterizedType, asPrimitiveType, asTypeVariable, asUnresolvedTypeVariable, asVoidType, create, hasAnnotation, name, toString
-
Field Details
-
OBJECT
-
isExtends
private final boolean isExtends -
bound
-
hash
private int hash
-
-
Constructor Details
-
WildcardType
WildcardType(Type bound, boolean isExtends) -
WildcardType
WildcardType(Type bound, boolean isExtends, AnnotationInstance[] annotations)
-
-
Method Details
-
create
Create a new mock instance of WildcardType.- Parameters:
bound
- the bound (lower or upper)isExtends
- true if lower, false if upper (super)- Returns:
- thew new mock instance
- Since:
- 2.1
-
extendsBound
Returns the extends (upper) bound of this wildcard. If this wildcard declares a super (lower) bound, this method will returnjava.lang.Object
- Returns:
- the extends bound, or Object if this wildcard has a super bound
-
superBound
Returns the super (lower) bound of this wildcard. If this wildcard declares an extends (upper) bound, this method will return nnull- Returns:
- the super bound, or null if this wildcard has a extends bound
-
bound
Type bound() -
isExtends
boolean isExtends() -
kind
Description copied from class:Type
Returns the kind of Type this is. -
asWildcardType
Description copied from class:Type
Casts this type to aWildcardType
and returns it if the kind isType.Kind.WILDCARD_TYPE
Throws an exception otherwise.- Overrides:
asWildcardType
in classType
- Returns:
- a
ClassType
-
toString
Description copied from class:Type
Returns a string representation for this type. It is similar, yet not equivalent to a Java source code representation. -
copyType
-
copyType
-
equals
Description copied from class:Type
Compares this Type with another type, and returns true if they are equivalent. A type is equivalent to another type if it is the same kind, and all of its fields are equal. This includes annotations, which must be equal as well. -
hashCode
public int hashCode()Description copied from class:Type
Computes a hash code representing this type.
-