public class WildcardArgument extends TypeArgument
The subclasses represent the type bound as given for the wildcard.
| Modifier and Type | Field and Description |
|---|---|
private WildcardType |
argumentType
The wildcard type.
|
| Constructor and Description |
|---|
WildcardArgument(WildcardType argumentType)
Initializes the bound type.
|
| Modifier and Type | Method and Description |
|---|---|
WildcardArgument |
applyCaptureConversion()
Applies a capture conversion to the bound of this
WildcardArgument. |
boolean |
contains(TypeArgument argument)
Checks whether this type argument contains another argument, using relationship defined in JLS Section
4.5.1.
|
boolean |
equals(@Nullable java.lang.Object obj) |
static WildcardArgument |
forType(ReferenceType argumentType) |
static WildcardArgument |
forType(java.lang.reflect.Type type)
Creates a
WildcardArgument from a java.lang.reflect.Type. |
java.lang.String |
getBinaryName()
Return the binary name.
|
java.lang.String |
getFqName()
Return the fully-qualified name.
|
@Nullable Substitution |
getInstantiatingSubstitution(TypeArgument goalType)
Returns a unifying substitution.
|
ParameterBound |
getTypeBound()
Return the type of the upper/lower bound of this wildcard argument.
|
java.util.List<TypeVariable> |
getTypeParameters()
The type parameters for this type argument.
|
(package private) WildcardType |
getWildcardType() |
boolean |
hasCaptureVariable()
Indicate whether this type argument has a capture variable.
|
int |
hashCode() |
(package private) boolean |
hasUpperBound()
Indicates whether this wildcard argument has an upper bound.
|
boolean |
hasWildcard()
Indicate whether this type argument has a wildcard.
|
boolean |
isGeneric(boolean ignoreWildcards)
Indicates whether this type argument is generic.
|
(package private) boolean |
isInstantiationOfTypeArgument(TypeArgument otherArgument)
Determines whether this type argument is an instantiation of the other argument.
|
boolean |
isVariable()
Indicate whether this type argument is a type variable.
|
boolean |
isWildcard()
Indicate whether this type argument is a wildcard argument.
|
WildcardArgument |
substitute(Substitution substitution)
Applies the type substitution to this type argument.
|
java.lang.String |
toString() |
isGenericprivate final WildcardType argumentType
WildcardArgument(WildcardType argumentType)
argumentType - the wildcard typepublic static WildcardArgument forType(java.lang.reflect.Type type)
WildcardArgument from a java.lang.reflect.Type. A wildcard may have
either an upper or lower bound.type - the Type objectWildcardArgument created from the given Typepublic static WildcardArgument forType(ReferenceType argumentType)
public boolean equals(@Nullable java.lang.Object obj)
equals in class java.lang.Objectpublic int hashCode()
hashCode in class java.lang.Objectpublic java.lang.String getFqName()
TypeArgumentgetFqName in class TypeArgumentpublic java.lang.String getBinaryName()
TypeArgumentgetBinaryName in class TypeArgumentpublic java.lang.String toString()
toString in class java.lang.Objectpublic WildcardArgument substitute(Substitution substitution)
TypeArgumentsubstitute in class TypeArgumentsubstitution - the substitutionpublic WildcardArgument applyCaptureConversion()
WildcardArgument.ReferenceType.applyCaptureConversion()public boolean contains(TypeArgument argument)
TypeArgumentcontains in class TypeArgumentargument - the other TypeArgumentpublic ParameterBound getTypeBound()
public java.util.List<TypeVariable> getTypeParameters()
Returns the type parameters of the bound of this wildcard argument
getTypeParameters in class TypeArgumentboolean hasUpperBound()
public boolean hasWildcard()
TypeArgumenthasWildcard in class TypeArgumentpublic boolean hasCaptureVariable()
TypeArgumenthasCaptureVariable in class TypeArgumentpublic boolean isGeneric(boolean ignoreWildcards)
TypeArgumentisGeneric in class TypeArgumentignoreWildcards - if true, ignore wildcards; that is, treat wildcards as not making the
operation genericboolean isInstantiationOfTypeArgument(TypeArgument otherArgument)
TypeArgumentisInstantiationOfTypeArgument in class TypeArgumentotherArgument - the other argumentInstantiatedType.isInstantiationOf(ReferenceType)public @Nullable Substitution getInstantiatingSubstitution(TypeArgument goalType)
TypeArgumentgetInstantiatingSubstitution in class TypeArgumentgoalType - the generic type for which a substitution is neededpublic boolean isWildcard()
TypeArgumentisWildcard in class TypeArgumentpublic boolean isVariable()
TypeArgumentisVariable in class TypeArgumentWildcardType getWildcardType()