public abstract class ParameterType extends ReferenceType
| Modifier and Type | Field and Description |
|---|---|
private ParameterBound |
lowerBound
The lower bound on this type.
|
private ParameterBound |
upperBound
The upper bound on this type.
|
| Constructor and Description |
|---|
ParameterType() |
ParameterType(ParameterBound lowerBound,
ParameterBound upperBound) |
| Modifier and Type | Method and Description |
|---|---|
boolean |
equals(@Nullable java.lang.Object object) |
java.lang.String |
getCanonicalName()
Returns the name of this type as the "canonical name" of the underlying runtime class.
|
ParameterBound |
getLowerTypeBound() |
@Nullable java.lang.Class<?> |
getRuntimeClass()
Returns the runtime
Class object for this type. |
java.util.List<TypeVariable> |
getTypeParameters()
Returns the list of type parameters for this type.
|
ParameterBound |
getUpperTypeBound() |
boolean |
hasCaptureVariable()
Indicates whether this
ReferenceType has a capture variable. |
boolean |
hasGenericBound()
Return true if this has a generic bound.
|
int |
hashCode() |
boolean |
hasWildcard()
Indicates whether this type has a wildcard anywhere within it.
|
(package private) void |
setLowerBound(ParameterBound lowerBound) |
(package private) void |
setUpperBound(ParameterBound upperBound) |
java.lang.String |
toString() |
applyCaptureConversion, forClass, forType, getInstantiatingSubstitution, getInstantiatingSubstitutionforTypeVariable, isAssignableFrom, isCaptureVariable, isInstantiationOf, isReferenceType, isSubtypeOf, substitutecompareTo, forFullyQualifiedName, forName, forValue, getBinaryName, getFqName, getRawtype, getSimpleName, getTypeforFullyQualifiedName, getUnqualifiedBinaryName, isArray, isAssignableFromTypeOf, isBoxedPrimitive, isClass, isClassOrInterfaceType, isEnum, isGeneric, isGeneric, isInterface, isNonreceiverType, isObject, isParameterized, isPrimitive, isRawtype, isString, isVariable, isVoid, runtimeClassIsprivate ParameterBound lowerBound
private ParameterBound upperBound
ParameterType()
ParameterType(ParameterBound lowerBound, ParameterBound upperBound)
public boolean equals(@Nullable java.lang.Object object)
equals in class java.lang.Objectpublic int hashCode()
hashCode in class java.lang.Objectpublic java.lang.String getCanonicalName()
TypeType.getFqName() except for types with type arguments. For java.util.List<T> returns "java.util.List". Returns null when Class<?>.getCanonicalName() does for the underlying Class<?> object (e.g., the type is
a local or anonymous class, or array type where the component type that has no canonical name).getCanonicalName in class Typepublic ParameterBound getLowerTypeBound()
public ParameterBound getUpperTypeBound()
public java.util.List<TypeVariable> getTypeParameters()
ReferenceTypeArrayType (such as E[]), and subclasses of ParameterizedType.getTypeParameters in class ReferenceTypepublic @Nullable java.lang.Class<?> getRuntimeClass()
Class object for this type. For use when reflection is needed.
Note that type variables and the null reference type do not have a runtime class, and this method will return null in those cases.
This method should not be confused with the inherited Object.getClass() method,
which returns the Class<?> for the Type object, and not of the represented
type. For instance, if a Type object t represented the Java type int,
then t.getRuntimeClass() would return int.class while t.getClass()
would return Type.class.
getRuntimeClass in class Typevoid setUpperBound(ParameterBound upperBound)
void setLowerBound(ParameterBound lowerBound)
public boolean hasWildcard()
TypehasWildcard in class Typepublic boolean hasCaptureVariable()
TypeReferenceType has a capture variable.hasCaptureVariable in class Typepublic boolean hasGenericBound()