- java.lang.Object
-
- io.leangen.geantyref.CaptureTypeImpl
-
- All Implemented Interfaces:
CaptureType,java.lang.reflect.Type
class CaptureTypeImpl extends java.lang.Object implements CaptureType
-
-
Field Summary
Fields Modifier and Type Field Description private java.lang.reflect.Type[]lowerBoundsprivate java.lang.reflect.Type[]upperBoundsprivate java.lang.reflect.TypeVariable<?>variableprivate java.lang.reflect.WildcardTypewildcard
-
Constructor Summary
Constructors Constructor Description CaptureTypeImpl(java.lang.reflect.WildcardType wildcard, java.lang.reflect.TypeVariable<?> variable)Creates an uninitialized CaptureTypeImpl.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.reflect.Type[]getLowerBounds()Returns an array of Type objects representing the lower bound(s) of this type variable.java.lang.reflect.TypeVariable<?>getTypeVariable()java.lang.reflect.Type[]getUpperBounds()Returns an array of Type objects representing the upper bound(s) of this capture.java.lang.reflect.WildcardTypegetWildcardType()(package private) voidinit(VarMap varMap)Initialize this CaptureTypeImpl.voidsetUpperBounds(java.lang.reflect.Type[] upperBounds)Overwrite the upper bounds of this capture.java.lang.StringtoString()
-
-
-
Constructor Detail
-
CaptureTypeImpl
CaptureTypeImpl(java.lang.reflect.WildcardType wildcard, java.lang.reflect.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 Detail
-
init
void init(VarMap varMap)
Initialize this CaptureTypeImpl. This is needed for type variable bounds referring to each other: we need the capture of the argument.
-
getLowerBounds
public java.lang.reflect.Type[] getLowerBounds()
Description copied from interface:CaptureTypeReturns 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:
getLowerBoundsin interfaceCaptureType- Returns:
- lower bound(s) of this capture
-
getUpperBounds
public java.lang.reflect.Type[] getUpperBounds()
Description copied from interface:CaptureTypeReturns 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:
getUpperBoundsin interfaceCaptureType- Returns:
- upper bound(s) of this capture
-
setUpperBounds
public void setUpperBounds(java.lang.reflect.Type[] upperBounds)
Description copied from interface:CaptureTypeOverwrite 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:
setUpperBoundsin interfaceCaptureType- Parameters:
upperBounds- upper bound(s) of this capture
-
getTypeVariable
public java.lang.reflect.TypeVariable<?> getTypeVariable()
- Specified by:
getTypeVariablein interfaceCaptureType- Returns:
- type variable associated to this capture
-
getWildcardType
public java.lang.reflect.WildcardType getWildcardType()
- Specified by:
getWildcardTypein interfaceCaptureType- Returns:
- wildcard type associated to this capture
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
-