public abstract static class TypeDescription.Generic.OfNonGenericType extends TypeDescription.Generic.AbstractBase
A raw type representation of a non-generic type. This raw type differs from a raw type in the Java programming language by representing a minimal erasure compared to Java's full erasure. This means that generic types are preserved as long as they do not involve a type variable. Nested type variables are erased on the deepest possible level.
All fields, methods, interfaces and the super type that are returned from this instance represent appropriately erased types.
Modifier and Type | Class and Description |
---|---|
static class |
TypeDescription.Generic.OfNonGenericType.ForErasure
A type description for a type erasure.
|
static class |
TypeDescription.Generic.OfNonGenericType.ForLoadedType
Represents a non-generic type for a loaded
Class . |
static class |
TypeDescription.Generic.OfNonGenericType.ForReifiedErasure
A representation of a raw type that preserves its generic super types' generic information with a minimum
but erases all of their members' types.
|
static class |
TypeDescription.Generic.OfNonGenericType.Latent
A latent description of a non-generic type.
|
TypeDescription.Generic.AbstractBase, TypeDescription.Generic.AnnotationReader, TypeDescription.Generic.Builder, TypeDescription.Generic.LazyProjection, TypeDescription.Generic.LazyProxy, TypeDescription.Generic.OfGenericArray, TypeDescription.Generic.OfNonGenericType, TypeDescription.Generic.OfParameterizedType, TypeDescription.Generic.OfTypeVariable, TypeDescription.Generic.OfWildcardType, TypeDescription.Generic.Visitor<T>
TypeDefinition.Sort, TypeDefinition.SuperClassIterator
NamedElement.WithDescriptor, NamedElement.WithGenericName, NamedElement.WithOptionalName, NamedElement.WithRuntimeName
ModifierReviewable.ForFieldDescription, ModifierReviewable.ForMethodDescription, ModifierReviewable.ForParameterDescription, ModifierReviewable.ForTypeDefinition, ModifierReviewable.OfAbstraction, ModifierReviewable.OfByteCodeElement, ModifierReviewable.OfEnumeration
AnnotationSource.Empty, AnnotationSource.Explicit
ANNOTATION, CLASS, OBJECT, UNDEFINED, VOID
RAW_TYPES_PROPERTY
EMPTY_NAME, NO_NAME
EMPTY_MASK
Constructor and Description |
---|
OfNonGenericType() |
Modifier and Type | Method and Description |
---|---|
<T> T |
accept(TypeDescription.Generic.Visitor<T> visitor)
Applies a visitor to this generic type description.
|
boolean |
equals(Object other) |
TypeDescription.Generic |
findBindingOf(TypeDescription.Generic typeVariable)
Returns the parameter binding of the supplied type variable.
|
String |
getActualName()
Returns the display name of this element as it is found in the source code.
|
FieldList<FieldDescription.InGenericShape> |
getDeclaredFields()
Returns the fields that this type declares.
|
MethodList<MethodDescription.InGenericShape> |
getDeclaredMethods()
Returns the methods that this type declares.
|
TypeList.Generic |
getInterfaces()
Returns the interfaces that this type implements.
|
TypeList.Generic |
getLowerBounds()
Returns the lower bounds of this type.
|
RecordComponentList<RecordComponentDescription.InGenericShape> |
getRecordComponents()
Returns the list of record components that are declared by this type.
|
TypeDefinition.Sort |
getSort()
Returns the sort of the generic type this instance represents.
|
StackSize |
getStackSize()
Returns the size of the type described by this instance.
|
TypeDescription.Generic |
getSuperClass()
Returns the super class of this type.
|
String |
getSymbol()
Returns the symbol of this type variable.
|
TypeList.Generic |
getTypeArguments()
Returns the type arguments of this type.
|
String |
getTypeName()
Returns the name of the type.
|
TypeVariableSource |
getTypeVariableSource()
Returns the source of this type variable.
|
TypeList.Generic |
getUpperBounds()
Returns the upper bounds of this type.
|
int |
hashCode() |
boolean |
isArray()
Checks if the type described by this entity is an array.
|
boolean |
isPrimitive()
Checks if the type described by this entity is a primitive type.
|
boolean |
isRecord()
Checks if this type is a Java record.
|
Iterator<TypeDefinition> |
iterator() |
boolean |
represents(Type type)
Checks if the type described by this instance represents
type . |
String |
toString() |
asGenericType, asRawType, getModifiers
getEnumerationState, getFieldManifestation, getFieldPersistence, getMethodManifestation, getMethodStrictness, getOwnership, getParameterManifestation, getProvisioningState, getSynchronizationState, getSyntheticState, getTypeManifestation, getVisibility, isAbstract, isAnnotation, isBridge, isDeprecated, isEnum, isFinal, isInterface, isMandated, isNative, isPackagePrivate, isPrivate, isProtected, isPublic, isStatic, isStrict, isSynchronized, isSynthetic, isTransient, isVarArgs, isVolatile
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
getComponentType, getOwnerType
asErasure
getTypeManifestation, isAnnotation, isInterface
isAbstract
getEnumerationState, isEnum
getOwnership, getVisibility, isDeprecated, isPackagePrivate, isPrivate, isProtected, isPublic, isStatic
getSyntheticState, isFinal, isSynthetic
forEach, spliterator
getDeclaredAnnotations
public TypeDefinition.Sort getSort()
@MaybeNull public TypeDescription.Generic getSuperClass()
TypeDefinition.Sort.NON_GENERIC
),
parameterized types (TypeDefinition.Sort.PARAMETERIZED
) or generic array types (TypeDefinition.Sort.GENERIC_ARRAY
) types. Interface types
and the Object
class do not define a super class where null
is returned. Array types define Object
as their direct super class.null
if no super class exists for this type.public TypeList.Generic getInterfaces()
TypeDefinition.Sort.NON_GENERIC
),
parameterized types (TypeDefinition.Sort.PARAMETERIZED
) or generic array types (TypeDefinition.Sort.GENERIC_ARRAY
) types.public FieldList<FieldDescription.InGenericShape> getDeclaredFields()
TypeDefinition.Sort.NON_GENERIC
),
parameterized types (TypeDefinition.Sort.PARAMETERIZED
) or generic array types (TypeDefinition.Sort.GENERIC_ARRAY
) types. Generic array
types never define fields and the returned list is always empty for such types.TypeDefinition.Sort.NON_GENERIC
),
parameterized types (TypeDefinition.Sort.PARAMETERIZED
) or generic array types (TypeDefinition.Sort.GENERIC_ARRAY
) types. Generic array
types never define methods and the returned list is always empty for such types.public MethodList<MethodDescription.InGenericShape> getDeclaredMethods()
public RecordComponentList<RecordComponentDescription.InGenericShape> getRecordComponents()
public TypeList.Generic getTypeArguments()
Returns the type arguments of this type.
Parameters are only well-defined for parameterized types (Sort#PARAMETERIZED
).
For all other types, this method throws an IllegalStateException
.
public TypeDescription.Generic findBindingOf(TypeDescription.Generic typeVariable)
Returns the parameter binding of the supplied type variable.
This method must only be called for parameterized types (Sort#PARAMETERIZED
). For all other types,
this method throws an IllegalStateException
.
typeVariable
- The type variable for which a value should be located.null
if the type variable
is not bound by this parameterized type.public <T> T accept(TypeDescription.Generic.Visitor<T> visitor)
T
- The value that this visitor yields.visitor
- The visitor to apply.public String getTypeName()
Object.toString()
representations. For a non-generic
type, it is the fully qualified binary name of the type.public TypeList.Generic getUpperBounds()
Returns the upper bounds of this type. Any type with a well-defined upper bound is bound by at least one type. If no such
type is defined, the bound is implicitly Object
.
Only non-symbolic type variables (TypeDefinition.Sort.VARIABLE
, and wildcard types
(TypeDefinition.Sort.WILDCARD
) have well-defined upper bounds. For other
types, an IllegalStateException
is thrown.
public TypeList.Generic getLowerBounds()
Returns the lower bounds of this type.
Only wildcard types (Sort#WILDCARD
) define a lower bound. For other
types, an IllegalStateException
is thrown.
public TypeVariableSource getTypeVariableSource()
Sort#VARIABLE
. For other types, this method
throws an IllegalStateException
.public String getSymbol()
Sort#VARIABLE
, Sort#VARIABLE_SYMBOLIC
). For other types, this method
throws an IllegalStateException
.public StackSize getStackSize()
TypeDescription.Generic.Sort#WILDCARD
do not have a well-defined a stack size and
cause an IllegalStateException
to be thrown.public String getActualName()
public boolean isArray()
true
if this type description represents an array.public boolean isPrimitive()
true
if this type description represents a primitive type.public boolean isRecord()
true
if this type is a Java record.public boolean represents(Type type)
type
.represents
in interface TypeDefinition
represents
in class TypeDescription.Generic.AbstractBase
type
- The type of interest.true
if the type described by this instance represents type
.public Iterator<TypeDefinition> iterator()
@CachedReturnPlugin.Enhance(value="hashCode") public int hashCode()
public boolean equals(@MaybeNull Object other)
Copyright © 2014–2023. All rights reserved.