public class CaptureConversion
extends java.lang.Object
CaptureConversion
is a special sort of bound which can be contained
within a BoundSet
. It represents a capture conversion, as the process
is described in the Java 8 language specification.
The captures made by this capture conversion are not yet fully instantiated,
meaning that the types of the capturing variables, and the bounds on those
types, may involve InferenceVariable
s.
Constructor and Description |
---|
CaptureConversion(java.lang.reflect.ParameterizedType originalType)
Create a capture conversion over a given
ParameterizedType . |
Modifier and Type | Method and Description |
---|---|
java.lang.reflect.Type |
getCapturedArgument(InferenceVariable variable) |
java.lang.reflect.TypeVariable<?> |
getCapturedParameter(InferenceVariable variable) |
java.lang.reflect.ParameterizedType |
getCaptureType() |
java.util.Set<InferenceVariable> |
getInferenceVariables() |
java.util.stream.Stream<InferenceVariable> |
getInferenceVariablesMentioned()
Find all inference variables mentioned by this capture conversion.
|
java.lang.reflect.ParameterizedType |
getOriginalType() |
java.lang.String |
toString() |
CaptureConversion |
withInferenceVariableSubstitution(Isomorphism isomorphism)
Substitute any mentions of the inference variables present as keys in the
given map with their associated values in the map.
|
public CaptureConversion(java.lang.reflect.ParameterizedType originalType)
ParameterizedType
.
Arguments will be substituted with new InferenceVariable
s, such
that a new type is described which represents the result of capture
conversion on the given type.originalType
- The type to capture.public java.lang.String toString()
toString
in class java.lang.Object
public java.lang.reflect.ParameterizedType getOriginalType()
public java.lang.reflect.ParameterizedType getCaptureType()
ParameterizedType
whose arguments are the same as those
in the original type
, or in the case of
WildcardTypes
, the InferenceVariable
s which capture
those arguments.public java.util.Set<InferenceVariable> getInferenceVariables()
public java.lang.reflect.Type getCapturedArgument(InferenceVariable variable)
variable
- An inference variable which may represent a capture which is part
of this capture conversion.original type
captured by a given InferenceVariable
.public java.lang.reflect.TypeVariable<?> getCapturedParameter(InferenceVariable variable)
variable
- An inference variable which may represent a capture which is part
of this capture conversion.original type
captured by a given InferenceVariable
.public CaptureConversion withInferenceVariableSubstitution(Isomorphism isomorphism)
isomorphism
- an isomorphism for inference variablesCaptureConversion
instance which is equal to the
receiving instance but for the substitutions made.public java.util.stream.Stream<InferenceVariable> getInferenceVariablesMentioned()