class LazyParameterBound extends ParameterBound
Modifier and Type | Class and Description |
---|---|
(package private) static class |
LazyParameterBound.LazyBoundException
There was an attempt to perform an operation, such as capture conversion, on a lazy bound.
|
Modifier and Type | Field and Description |
---|---|
private java.lang.reflect.Type |
boundType
The type for this bound.
|
Constructor and Description |
---|
LazyParameterBound(java.lang.reflect.Type boundType)
Creates a
LazyParameterBound from the given rawtype and type parameters. |
Modifier and Type | Method and Description |
---|---|
ParameterBound |
applyCaptureConversion()
Applies a capture conversion to any wildcard arguments in the type of this bound.
|
boolean |
equals(@Nullable java.lang.Object obj) |
java.util.List<TypeVariable> |
getTypeParameters()
Returns any type parameters in the type of this bound.
|
private static java.util.List<TypeVariable> |
getTypeParameters(java.lang.reflect.Type type)
Collects the type parameters from the given reflection
Type object. |
boolean |
hasCaptureVariable()
Indicates whether the type of this bound has a capture variable.
|
private static boolean |
hasCaptureVariable(java.lang.reflect.Type type)
Return true if the given type has a capture variable.
|
int |
hashCode() |
(package private) boolean |
hasWildcard()
Indicates whether the type of this bound has a wildcard type argument.
|
private static boolean |
hasWildcard(java.lang.reflect.Type type) |
boolean |
isGeneric(boolean ignoreWildcards)
Indicates whether the type of this bound is generic.
|
boolean |
isLowerBound(Type argType,
Substitution substitution)
Indicates whether this bound is a lower bound of the given argument type.
|
boolean |
isObject()
Indicate whether this bound is
Object . |
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.
|
boolean |
isVariable()
Indicates whether this bound is a type variable.
|
ParameterBound |
substitute(Substitution substitution)
Applies the given substitution to this type bound by replacing type variables.
|
private static TypeArgument |
substitute(java.lang.reflect.Type type,
Substitution substitution)
Applies a substitution to a reflection type that occurs as an actual argument of a
parameterized type bound, to create a type argument to a
ParameterizedType . |
java.lang.String |
toString() |
forType, forType, forTypes, isGeneric, isLowerBound, isTypeVariable
LazyParameterBound(java.lang.reflect.Type boundType)
LazyParameterBound
from the given rawtype and type parameters.boundType
- the reflection type for this boundpublic boolean equals(@Nullable java.lang.Object obj)
equals
in class java.lang.Object
LazyParameterBound
, and the rawtype and parameters are
identical, false otherwisepublic int hashCode()
hashCode
in class java.lang.Object
public java.lang.String toString()
toString
in class java.lang.Object
public ParameterBound substitute(Substitution substitution)
ParameterBound
substitute
in class ParameterBound
substitution
- the type substitutionprivate static TypeArgument substitute(java.lang.reflect.Type type, Substitution substitution)
ParameterizedType
.type
- the reflection typesubstitution
- the type substitutionpublic ParameterBound applyCaptureConversion()
ParameterBound
applyCaptureConversion
in class ParameterBound
ReferenceType.applyCaptureConversion()
public java.util.List<TypeVariable> getTypeParameters()
ParameterBound
getTypeParameters
in class ParameterBound
TypeVariable
objects in this boundprivate static java.util.List<TypeVariable> getTypeParameters(java.lang.reflect.Type type)
Type
object.type
- the Type
referenceboolean hasWildcard()
ParameterBound
hasWildcard
in class ParameterBound
private static boolean hasWildcard(java.lang.reflect.Type type)
public boolean hasCaptureVariable()
ParameterBound
hasCaptureVariable
in class ParameterBound
private static boolean hasCaptureVariable(java.lang.reflect.Type type)
type
- the type to testpublic boolean isGeneric(boolean ignoreWildcards)
ParameterBound
isGeneric
in class ParameterBound
ignoreWildcards
- if true, ignore wildcards; that is, treat wildcards as not making the
operation genericpublic boolean isLowerBound(Type argType, Substitution substitution)
ParameterBound
isLowerBound
in class ParameterBound
argType
- the concrete argument typesubstitution
- the substitutionpublic boolean isObject()
ParameterBound
Object
.isObject
in class ParameterBound
Object
, false otherwisepublic boolean isSubtypeOf(ParameterBound boundType)
ParameterBound
isSubtypeOf
in class ParameterBound
boundType
- the other boundpublic boolean isUpperBound(Type argType, Substitution substitution)
This generic type bound is satisfied by a concrete type if the concrete type formed by applying the substitution to this generic bound is satisfied by the concrete type.
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 substitutionpublic boolean isVariable()
ParameterBound
isVariable
in class ParameterBound