public class TypeVariableCapture
extends java.lang.Object
implements java.lang.reflect.Type
Modifier and Type | Method and Description |
---|---|
static BoundSet |
captureInferenceVariables(java.util.Collection<? extends InferenceVariable> types,
BoundSet bounds)
Capture fresh type variables as valid stand-in instantiations for a set of
inference variables.
|
static TypeVariableCapture |
captureWildcard(java.lang.reflect.TypeVariable<?> typeVariable,
java.lang.reflect.WildcardType type)
Capture new type variable instantiation over a given wildcard type.
|
static TypeVariableCapture |
captureWildcard(java.lang.reflect.WildcardType type)
Capture new type variable instantiation over a given wildcard type.
|
static java.lang.reflect.GenericArrayType |
captureWildcardArguments(java.lang.reflect.GenericArrayType type)
Capture new type variable instantiations over any wildcard arguments of the
given generic array type.
|
static java.lang.reflect.ParameterizedType |
captureWildcardArguments(java.lang.reflect.ParameterizedType type)
Capture new type variable instantiations over any wildcard arguments of the
given parameterized type.
|
java.lang.reflect.Type |
getCapturedType() |
java.lang.reflect.Type[] |
getLowerBounds() |
java.lang.String |
getName() |
java.lang.reflect.Type[] |
getUpperBounds() |
boolean |
isPossibleInstantiation(java.lang.reflect.Type type)
Determine whether a given type is a valid instantiation of this
TypeVariableCapture, or in other words, whether it is contained by the bounds
of this capture.
|
java.lang.String |
toString() |
public java.lang.String getName()
public java.lang.reflect.Type getCapturedType()
InferenceVariable
or WildcardType
captured by
this type variable capture.public java.lang.String toString()
toString
in class java.lang.Object
public boolean isPossibleInstantiation(java.lang.reflect.Type type)
type
- The potential instantiation to validate.public java.lang.reflect.Type[] getUpperBounds()
public java.lang.reflect.Type[] getLowerBounds()
public static java.lang.reflect.GenericArrayType captureWildcardArguments(java.lang.reflect.GenericArrayType type)
type
- The generic array type whose arguments we wish to capture.public static java.lang.reflect.ParameterizedType captureWildcardArguments(java.lang.reflect.ParameterizedType type)
type
- The parameterized type whose arguments we wish to capture.public static TypeVariableCapture captureWildcard(java.lang.reflect.TypeVariable<?> typeVariable, java.lang.reflect.WildcardType type)
typeVariable
- The type variable the new capture of the given wildcard is intended
to represent an instantiation of.type
- The parameterized type whose arguments we wish to capture.public static TypeVariableCapture captureWildcard(java.lang.reflect.WildcardType type)
type
- The parameterized type whose arguments we wish to capture.public static BoundSet captureInferenceVariables(java.util.Collection<? extends InferenceVariable> types, BoundSet bounds)
types
- The inference variables to capture.bounds
- The context from which to determine the current bounds on the given
inference variables, and to incorporate new bounds into.