java.lang.Object
io.leangen.geantyref.CaptureTypeImpl
- All Implemented Interfaces:
CaptureType
,Type
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final Type[]
private Type[]
private final TypeVariable
<?> private final WildcardType
-
Constructor Summary
ConstructorsConstructorDescriptionCaptureTypeImpl
(WildcardType wildcard, TypeVariable<?> variable) Creates an uninitialized CaptureTypeImpl. -
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.(package private) void
Initialize this CaptureTypeImpl.void
setUpperBounds
(Type[] upperBounds) Overwrite the upper bounds of this capture.toString()
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface java.lang.reflect.Type
getTypeName
-
Field Details
-
wildcard
-
variable
-
lowerBounds
-
upperBounds
-
-
Constructor Details
-
CaptureTypeImpl
CaptureTypeImpl(WildcardType wildcard, TypeVariable<?> variable) Creates an uninitialized CaptureTypeImpl. Before using this type,init(VarMap)
must be called.- Parameters:
wildcard
- The wildcard this is a capture ofvariable
- The type variable where the wildcard is a parameter for.
-
-
Method Details
-
init
Initialize this CaptureTypeImpl. This is needed for type variable bounds referring to each other: we need the capture of the argument. -
getLowerBounds
Description copied from interface:CaptureType
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()
.- Specified by:
getLowerBounds
in interfaceCaptureType
- Returns:
- lower bound(s) of this capture
-
getUpperBounds
Description copied from interface:CaptureType
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.- Specified by:
getUpperBounds
in interfaceCaptureType
- Returns:
- upper bound(s) of this capture
-
setUpperBounds
Description copied from interface:CaptureType
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.- Specified by:
setUpperBounds
in interfaceCaptureType
- Parameters:
upperBounds
- upper bound(s) of this capture
-
getTypeVariable
- Specified by:
getTypeVariable
in interfaceCaptureType
- Returns:
- type variable associated to this capture
-
getWildcardType
- Specified by:
getWildcardType
in interfaceCaptureType
- Returns:
- wildcard type associated to this capture
-
toString
-