public abstract class TypeArgument
extends java.lang.Object
TypeArgument: ReferenceType Wildcard
ReferenceArgument
,
WildcardArgument
Constructor and Description |
---|
TypeArgument() |
Modifier and Type | Method and Description |
---|---|
abstract boolean |
contains(TypeArgument otherArgument)
Checks whether this type argument contains another argument, using relationship defined in JLS Section
4.5.1.
|
static TypeArgument |
forType(ReferenceType referenceType) |
static TypeArgument |
forType(java.lang.reflect.Type type)
Converts a
java.lang.reflect.Type to a TypeArgument object. |
abstract java.lang.String |
getBinaryName()
Return the binary name.
|
abstract java.lang.String |
getFqName()
Return the fully-qualified name.
|
@Nullable Substitution |
getInstantiatingSubstitution(TypeArgument goalType)
Returns a unifying substitution.
|
java.util.List<TypeVariable> |
getTypeParameters()
The type parameters for this type argument.
|
boolean |
hasCaptureVariable()
Indicate whether this type argument has a capture variable.
|
boolean |
hasWildcard()
Indicate whether this type argument has a wildcard.
|
boolean |
isGeneric()
Indicates whether this type argument is generic.
|
abstract 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.
|
abstract boolean |
isVariable()
Indicate whether this type argument is a type variable.
|
boolean |
isWildcard()
Indicate whether this type argument is a wildcard argument.
|
abstract TypeArgument |
substitute(Substitution substitution)
Applies the type substitution to this type argument.
|
public static TypeArgument forType(java.lang.reflect.Type type)
java.lang.reflect.Type
to a TypeArgument
object.type
- the type of a type argumentTypeArgument
for the given typepublic static TypeArgument forType(ReferenceType referenceType)
public abstract TypeArgument substitute(Substitution substitution)
substitution
- the substitutionpublic abstract boolean contains(TypeArgument otherArgument)
otherArgument
- the other TypeArgument
public java.util.List<TypeVariable> getTypeParameters()
public boolean hasWildcard()
public boolean hasCaptureVariable()
public final boolean isGeneric()
public abstract boolean isGeneric(boolean ignoreWildcards)
ignoreWildcards
- if true, ignore wildcards; that is, treat wildcards as not making the
operation genericboolean isInstantiationOfTypeArgument(TypeArgument otherArgument)
otherArgument
- the other argumentInstantiatedType.isInstantiationOf(ReferenceType)
public boolean isWildcard()
public @Nullable Substitution getInstantiatingSubstitution(TypeArgument goalType)
goalType
- the generic type for which a substitution is neededpublic abstract boolean isVariable()
public abstract java.lang.String getFqName()
public abstract java.lang.String getBinaryName()