Package org.jboss.jandex
Class WildcardType
- java.lang.Object
-
- org.jboss.jandex.Type
-
- org.jboss.jandex.WildcardType
-
public class WildcardType extends Type
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
-
-
Constructor Summary
Constructors Constructor Description WildcardType(Type bound, boolean isExtends)WildcardType(Type bound, boolean isExtends, AnnotationInstance[] annotations)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description WildcardTypeasWildcardType()Casts this type to aWildcardTypeand returns it if the kind isType.Kind.WILDCARD_TYPEThrows an exception otherwise.(package private) Typebound()(package private) TypecopyType(AnnotationInstance[] newAnnotations)(package private) TypecopyType(Type bound)static WildcardTypecreate(Type bound, boolean isExtends)Create a new mock instance of WildcardType.booleanequals(java.lang.Object o)Compares this Type with another type, and returns true if they are equivalent.TypeextendsBound()Returns the extends (upper) bound of this wildcard.inthashCode()Computes a hash code representing this type.(package private) booleanisExtends()Type.Kindkind()Returns the kind of Type this is.TypesuperBound()Returns the super (lower) bound of this wildcard.java.lang.StringtoString()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
-
-
-
-
Constructor Detail
-
WildcardType
WildcardType(Type bound, boolean isExtends)
-
WildcardType
WildcardType(Type bound, boolean isExtends, AnnotationInstance[] annotations)
-
-
Method Detail
-
create
public static WildcardType create(Type bound, boolean isExtends)
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
public Type 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
public Type 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()
-
asWildcardType
public WildcardType asWildcardType()
Description copied from class:TypeCasts this type to aWildcardTypeand returns it if the kind isType.Kind.WILDCARD_TYPEThrows an exception otherwise.- Overrides:
asWildcardTypein classType- Returns:
- a
ClassType
-
toString
public java.lang.String toString()
Description copied from class:TypeReturns a string representation for this type. It is similar, yet not equivalent to a Java source code representation.
-
copyType
Type copyType(AnnotationInstance[] newAnnotations)
-
equals
public boolean equals(java.lang.Object o)
Description copied from class:TypeCompares 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.
-
-