public class BoundsCheck
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
private java.util.List<TypeVariable> |
typeParameters
The type variables to check against.
|
Constructor and Description |
---|
BoundsCheck(java.util.List<TypeVariable> typeParameters)
Creates a
BoundsCheck predicate for a given list of type parameters. |
Modifier and Type | Method and Description |
---|---|
boolean |
test(java.util.List<ReferenceType> tuple,
Substitution substitution)
Checks if each type argument is within the bounds of the corresponding type parameter, after
both arguments and parameters have been substituted.
|
private final java.util.List<TypeVariable> typeParameters
public BoundsCheck(java.util.List<TypeVariable> typeParameters)
BoundsCheck
predicate for a given list of type parameters.typeParameters
- the list of type parameters to be checked by the predicatepublic boolean test(java.util.List<ReferenceType> tuple, Substitution substitution)
Requires that the list of types be the same length as the parameters. Generally, the substitution is constructed from the tuple instantiating the type parameters of this object, but all that is required is that it instantiate any generic bounds of the type parameters.
tuple
- the list of instantiating typessubstitution
- substitution for checking bounds