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".
- Author:
- Jason T. Greene
- Since:
- 2.0
-
Nested Class Summary
-
Field Summary
Fields inherited from class org.jboss.jandex.Type
EMPTY_ARRAY -
Method Summary
Modifier and TypeMethodDescriptionCasts this type to aWildcardTypeand returns it if the kind isType.Kind.WILDCARD_TYPE.static WildcardTypeCreate a new mock instance of WildcardType.booleanCompares thisTypewith another type.Returns the upper bound of this wildcard (e.g.inthashCode()Computes a hash code representing this type.booleanintkind()Returns the kind of Type this is.name()Returns the raw name of this type.Returns the lower bound of this wildcard (e.g.Methods inherited from class org.jboss.jandex.Type
annotation, annotations, annotationsWithRepeatable, asArrayType, asClassType, asParameterizedType, asPrimitiveType, asTypeVariable, asTypeVariableReference, asUnresolvedTypeVariable, asVoidType, create, createWithAnnotations, hasAnnotation, toString
-
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
-
name
Description copied from class:TypeReturns the raw name of this type. Primitives and void are returned as the Java keyword (void, boolean, byte, short, int, long, float, double, char). Arrays are returned using the Java reflection array syntax (e.g.[[[Ljava.lang.String;) Classes are returned as a normalDotName.Generic values are returned as the underlying raw value. For example, a wildcard such as
? extends Numberhas a raw type ofNumber. -
extendsBound
Returns the upper bound of this wildcard (e.g.SomeTypefor? extends SomeType).Returns
java.lang.Objectif this wildcard declares a lower bound (? super SomeType).- Returns:
- the upper bound, or
Objectif this wildcard has a lower bound
-
superBound
Returns the lower bound of this wildcard (e.g.SomeTypefor? super SomeType).Returns
nullif this wildcard declares an upper bound (? extends SomeType).- Returns:
- the lower bound, or
nullif this wildcard has an uper bound
-
kind
Description copied from class:TypeReturns the kind of Type this is. -
asWildcardType
Description copied from class:TypeCasts this type to aWildcardTypeand returns it if the kind isType.Kind.WILDCARD_TYPE. Throws an exception otherwise.- Overrides:
asWildcardTypein classType- Returns:
- a
WildcardType
-
equals
Description copied from class:TypeCompares thisTypewith another type. A type is equal to another type if it is of the same kind, and all of their fields are equal. This includes annotations, which must be equal as well. -
hashCode
public int hashCode()Description copied from class:TypeComputes a hash code representing this type. -
internEquals
- Overrides:
internEqualsin classType
-
internHashCode
public int internHashCode()- Overrides:
internHashCodein classType
-