public class ReferenceArgument extends TypeArgument
| Modifier and Type | Field and Description |
|---|---|
private ReferenceType |
referenceType
The reference type for this argument.
|
| Modifier | Constructor and Description |
|---|---|
private |
ReferenceArgument(ReferenceType referenceType)
Creates a
ReferenceArgument for the given ReferenceType. |
| Modifier and Type | Method and Description |
|---|---|
boolean |
contains(TypeArgument otherArgument)
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 ReferenceArgument |
forType(ReferenceType referenceType) |
static ReferenceArgument |
forType(java.lang.reflect.Type type)
Creates a
ReferenceArgument from the given type. |
java.lang.String |
getBinaryName()
Return the binary name.
|
java.lang.String |
getFqName()
Return the fully-qualified name.
|
@Nullable Substitution |
getInstantiatingSubstitution(TypeArgument otherArgument)
Returns a unifying substitution.
|
ReferenceType |
getReferenceType()
Get the reference type for this type argument.
|
java.util.List<TypeVariable> |
getTypeParameters()
The type parameters for this type argument.
|
boolean |
hasCaptureVariable()
Indicate whether this type argument has a capture variable.
|
int |
hashCode() |
boolean |
hasWildcard()
Indicate whether this type argument has a wildcard.
|
boolean |
isGeneric(boolean ignoreWildcards)
Indicates whether a
ReferenceArgument 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.
|
TypeArgument |
substitute(Substitution substitution)
Applies the type substitution to this type argument.
|
java.lang.String |
toString() |
isGeneric, isWildcardprivate final ReferenceType referenceType
private ReferenceArgument(ReferenceType referenceType)
ReferenceArgument for the given ReferenceType.referenceType - the ReferenceTypepublic static ReferenceArgument forType(java.lang.reflect.Type type)
ReferenceArgument from the given type.type - the typeReferenceArgument for the given typepublic static ReferenceArgument forType(ReferenceType referenceType)
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 TypeArgument substitute(Substitution substitution)
TypeArgumentsubstitute in class TypeArgumentsubstitution - the substitutionpublic boolean contains(TypeArgument otherArgument)
Considers cases:
T contains T
T contains ? extends T
T contains ? super T
contains in class TypeArgumentotherArgument - the other TypeArgumentpublic ReferenceType getReferenceType()
public java.util.List<TypeVariable> getTypeParameters()
TypeArgumentgetTypeParameters in class TypeArgumentpublic boolean hasWildcard()
TypeArgumenthasWildcard in class TypeArgumentpublic boolean hasCaptureVariable()
TypeArgumenthasCaptureVariable in class TypeArgumentpublic boolean isGeneric(boolean ignoreWildcards)
ReferenceArgument is generic.isGeneric in class TypeArgumentignoreWildcards - if true, ignore wildcards; that is, treat wildcards as not making the
operation genericReferenceType is generic, false otherwiseboolean isInstantiationOfTypeArgument(TypeArgument otherArgument)
TypeArgumentisInstantiationOfTypeArgument in class TypeArgumentotherArgument - the other argumentInstantiatedType.isInstantiationOf(ReferenceType)public @Nullable Substitution getInstantiatingSubstitution(TypeArgument otherArgument)
TypeArgumentgetInstantiatingSubstitution in class TypeArgumentotherArgument - the generic type for which a substitution is neededpublic boolean isVariable()
TypeArgumentisVariable in class TypeArgument