class LazyReferenceBound extends ReferenceBound
LazyParameterBound
, but this class uses ReferenceType
as the bound instead of
java.lang.reflect.Type
. Also, prevents access to recursive type bounds, that would
otherwise result in nonterminating calls to getTypeParameters()
.
Objects of this class are created by LazyParameterBound.substitute(Substitution)
when
the substitution would replace a type variable with another type variable.
Constructor and Description |
---|
LazyReferenceBound(ReferenceType boundType) |
Modifier and Type | Method and Description |
---|---|
ReferenceBound |
applyCaptureConversion()
Applies a capture conversion to any wildcard arguments in the type of this bound.
|
java.util.List<TypeVariable> |
getTypeParameters()
Returns any type parameters in the type of this bound.
|
int |
hashCode() |
boolean |
isLowerBound(Type argType,
Substitution substitution)
Indicates whether this bound is a lower bound of the given argument type.
|
boolean |
isSubtypeOf(ParameterBound boundType)
Indicates whether the type of this bound is a subtype of the type of the given bound.
|
(package private) boolean |
isUpperBound(ParameterBound bound,
Substitution substitution)
Indicates whether this bound is an upper bound on the type of the given bound with respect to
the type substitution.
|
boolean |
isUpperBound(Type argType,
Substitution substitution)
Determines if this bound is an upper bound for the argument type.
|
ReferenceBound |
substitute(Substitution substitution)
Applies the given substitution to this type bound by replacing type variables.
|
equals, getBoundType, hasCaptureVariable, hasWildcard, isGeneric, isObject, isVariable, toString
forType, forType, forTypes, isGeneric, isLowerBound, isTypeVariable
LazyReferenceBound(ReferenceType boundType)
public int hashCode()
LazyReferenceBound
can be part of a recursive type, and so the hash code is based on
the string representation of the bound to avoid recursive calls on hashCode()
.
hashCode
in class ReferenceBound
public ReferenceBound substitute(Substitution substitution)
ParameterBound
substitute
in class ReferenceBound
substitution
- the type substitutionpublic ReferenceBound applyCaptureConversion()
ParameterBound
applyCaptureConversion
in class ReferenceBound
ReferenceType.applyCaptureConversion()
public java.util.List<TypeVariable> getTypeParameters()
ParameterBound
getTypeParameters
in class ParameterBound
TypeVariable
objects in this boundpublic boolean isLowerBound(Type argType, Substitution substitution)
ParameterBound
isLowerBound
in class ParameterBound
argType
- the concrete argument typesubstitution
- the substitutionpublic boolean isSubtypeOf(ParameterBound boundType)
ParameterBound
isSubtypeOf
in class ParameterBound
boundType
- the other boundpublic boolean isUpperBound(Type argType, Substitution substitution)
ParameterBound
isUpperBound
in class ParameterBound
argType
- the concrete argument typesubstitution
- the substitutionboolean isUpperBound(ParameterBound bound, Substitution substitution)
ParameterBound
isUpperBound
in class ParameterBound
bound
- the other boundsubstitution
- the type substitution