class NullReferenceType extends ReferenceType
null type is the type of the value null. As the subtype of all reference
types, it is the default lowerbound of a CaptureTypeVariable.| Modifier and Type | Field and Description |
|---|---|
private static NullReferenceType |
value |
| Modifier | Constructor and Description |
|---|---|
private |
NullReferenceType() |
| Modifier and Type | Method and Description |
|---|---|
boolean |
equals(@Nullable java.lang.Object obj) |
java.lang.String |
getBinaryName()
Returns the binary name of this type, including type arguments if this is a parameterized type
(so, it isn't really a binary name).
|
java.lang.String |
getCanonicalName()
Returns the name of this type as the "canonical name" of the underlying runtime class.
|
java.lang.String |
getFqName()
Returns the fully-qualified name of this type, including type arguments if this is a
parameterized type.
|
(package private) static NullReferenceType |
getNullType()
Returns the null type.
|
java.lang.Class<?> |
getRuntimeClass()
Returns the runtime
Class object for this type. |
java.lang.String |
getSimpleName()
Returns the name of this type without type arguments or package qualifiers.
|
boolean |
hasCaptureVariable()
Indicates whether this
ReferenceType has a capture variable. |
int |
hashCode() |
boolean |
hasWildcard()
Indicates whether this type has a wildcard anywhere within it.
|
boolean |
isSubtypeOf(Type otherType)
Test whether this type is a subtype of the given type according to transitive closure of
definition of the direct supertype relation in section 4.10 of
JLS for Java SE 8.
|
ReferenceType |
substitute(Substitution substitution)
Applies a substitution to a
ReferenceType. |
applyCaptureConversion, forClass, forType, getInstantiatingSubstitution, getInstantiatingSubstitutionforTypeVariable, getTypeParameters, isAssignableFrom, isCaptureVariable, isInstantiationOf, isReferenceTypecompareTo, forFullyQualifiedName, forName, forValue, getRawtype, getTypeforFullyQualifiedName, getUnqualifiedBinaryName, isArray, isAssignableFromTypeOf, isBoxedPrimitive, isClass, isClassOrInterfaceType, isEnum, isGeneric, isGeneric, isInterface, isNonreceiverType, isObject, isParameterized, isPrimitive, isRawtype, isString, isVariable, isVoid, runtimeClassIs, toStringprivate static final NullReferenceType value
static NullReferenceType getNullType()
public boolean equals(@Nullable java.lang.Object obj)
equals in class java.lang.Objectpublic int hashCode()
hashCode in class java.lang.Objectpublic 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.
This method returns null since the NullReferenceType does not have a runtime
representation
getRuntimeClass in class TypeClass that is the runtime representation of the type, or null if this type
is a type variable or null reference typepublic ReferenceType substitute(Substitution substitution)
ReferenceTypeReferenceType. If the type is parameterized then replaces
type variables that occur, otherwise returns this type.
This abstract method forces typing of substitutions applied to ReferenceType objects
without an explicit cast.
substitute in class ReferenceTypesubstitution - the type substitutionpublic java.lang.String getFqName()
Typejava.util.List<T> return "java.util.List<T>".public java.lang.String getBinaryName()
Typejava.util.List<T> return "java.util.List<T>".getBinaryName in class Typepublic java.lang.String getSimpleName()
Typejava.util.List<T>, returns "List".getSimpleName in class Typepublic 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 boolean hasWildcard()
TypehasWildcard in class Typepublic boolean hasCaptureVariable()
TypeReferenceType has a capture variable.hasCaptureVariable in class Typepublic boolean isSubtypeOf(Type otherType)
ReferenceTypeFor ReferenceType, returns true if otherType is Object.
isSubtypeOf in class ReferenceTypeotherType - the possible supertype