- All Superinterfaces:
Type
- All Known Implementing Classes:
CaptureTypeImpl
CaptureType represents a wildcard that has gone through capture conversion.
It is a custom subinterface of Type, not part of the java builtin Type hierarchy.
-
Method Summary
Modifier and TypeMethodDescriptionType[]
Returns an array of Type objects representing the lower bound(s) of this type variable.TypeVariable
<?> Type[]
Returns an array of Type objects representing the upper bound(s) of this capture.void
setUpperBounds
(Type[] upperBounds) Overwrite the upper bounds of this capture.Methods inherited from interface java.lang.reflect.Type
getTypeName
-
Method Details
-
getUpperBounds
Type[] getUpperBounds()Returns an array of Type objects representing the upper bound(s) of this capture. This includes both the upper bound of a ? extends wildcard, and the bounds declared with the type variable. References to other (or the same) type variables in bounds coming from the type variable are replaced by their matching capture.- Returns:
- upper bound(s) of this capture
-
setUpperBounds
Overwrite the upper bounds of this capture. Should not normally be used. When transforming a capture type into its annotated version, it might be necessary to set the upper bounds in a separate step to break an otherwise infinite recursion.- Parameters:
upperBounds
- upper bound(s) of this capture
-
getLowerBounds
Type[] getLowerBounds()Returns an array of Type objects representing the lower bound(s) of this type variable. This is the bound of a ? super wildcard. This normally contains only one or no types; it is an array for consistency withWildcardType.getLowerBounds()
.- Returns:
- lower bound(s) of this capture
-
getTypeVariable
TypeVariable<?> getTypeVariable()- Returns:
- type variable associated to this capture
-
getWildcardType
WildcardType getWildcardType()- Returns:
- wildcard type associated to this capture
-