public interface WildcardType extends Type
? extends Closeable or the lower bounded wildcard ? super String.
Although this interface permits an arbitrary number of upper and lower bounds, all wildcard types of Java language programs are in one of two forms:
? extends java.lang.Number. When the upper bound is
java.lang.Object, the extends java.lang.Object suffix is
optional: Set<?> is shorthand for Set<? extends java.lang.Object>.
java.lang.Object. Such types are written like ? super java.lang.String.
| Modifier and Type | Method and Description |
|---|---|
Type[] |
getLowerBounds()
Returns the array of types that represent the lower bounds of this type.
|
Type[] |
getUpperBounds()
Returns the array of types that represent the upper bounds of this type.
|
Type[] getUpperBounds()
Object.TypeNotPresentException - if any of the bounds points to a missing typeMalformedParameterizedTypeException - if any bound points to a type that cannot be instantiated for
some reasonType[] getLowerBounds()
null, in which case an empty array is
returned. Since only one lower bound is allowed, the returned array's
length will never exceed one.TypeNotPresentException - if any of the bounds points to a missing typeMalformedParameterizedTypeException - if any of the bounds points to a type that cannot be
instantiated for some reason