Class TypeDescription.Generic.OfParameterizedType
- All Implemented Interfaces:
Iterable<TypeDefinition>
,AnnotationSource
,ModifierReviewable
,ModifierReviewable.ForFieldDescription
,ModifierReviewable.ForMethodDescription
,ModifierReviewable.ForParameterDescription
,ModifierReviewable.ForTypeDefinition
,ModifierReviewable.OfAbstraction
,ModifierReviewable.OfByteCodeElement
,ModifierReviewable.OfEnumeration
,NamedElement
,TypeDefinition
,TypeDescription.Generic
- Direct Known Subclasses:
TypeDescription.Generic.OfParameterizedType.ForGenerifiedErasure
,TypeDescription.Generic.OfParameterizedType.ForLoadedType
,TypeDescription.Generic.OfParameterizedType.ForReifiedType
,TypeDescription.Generic.OfParameterizedType.Latent
,TypePool.Default.LazyTypeDescription.GenericTypeToken.ForParameterizedType.LazyParameterizedType
,TypePool.Default.LazyTypeDescription.GenericTypeToken.ForParameterizedType.Nested.LazyParameterizedType
,TypePool.Default.LazyTypeDescription.LazyMethodDescription.LazyParameterizedReceiverType
- Enclosing interface:
TypeDescription.Generic
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic class
Represents an erasure as a generic type where all type variables are representing their own arguments.static class
Description of a loaded parameterized type.static class
A representation of a parameterized type that is a super type of a raw type but preserves the minimal type information that is required for allowing creating correct erasures for overridden methods.static class
A latent description of a parameterized type.protected static enum
A rendering delegate for resolving a parameterized type'sObject.toString()
representation.Nested classes/interfaces inherited from interface net.bytebuddy.description.annotation.AnnotationSource
AnnotationSource.Empty, AnnotationSource.Explicit
Nested classes/interfaces inherited from interface net.bytebuddy.description.ModifierReviewable
ModifierReviewable.AbstractBase, ModifierReviewable.ForFieldDescription, ModifierReviewable.ForMethodDescription, ModifierReviewable.ForParameterDescription, ModifierReviewable.ForTypeDefinition, ModifierReviewable.OfAbstraction, ModifierReviewable.OfByteCodeElement, ModifierReviewable.OfEnumeration
Nested classes/interfaces inherited from interface net.bytebuddy.description.NamedElement
NamedElement.WithDescriptor, NamedElement.WithGenericName, NamedElement.WithOptionalName, NamedElement.WithRuntimeName
Nested classes/interfaces inherited from interface net.bytebuddy.description.type.TypeDefinition
TypeDefinition.Sort, TypeDefinition.SuperClassIterator
Nested classes/interfaces inherited from interface net.bytebuddy.description.type.TypeDescription.Generic
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>
-
Field Summary
Fields inherited from interface net.bytebuddy.description.ModifierReviewable
EMPTY_MASK
Fields inherited from interface net.bytebuddy.description.NamedElement
EMPTY_NAME, NO_NAME
Fields inherited from interface net.bytebuddy.description.type.TypeDefinition
RAW_TYPES_PROPERTY
Fields inherited from interface net.bytebuddy.description.type.TypeDescription.Generic
ANNOTATION, CLASS, OBJECT, UNDEFINED, VOID
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescription<T> T
accept
(TypeDescription.Generic.Visitor<T> visitor) Applies a visitor to this generic type description.boolean
findBindingOf
(TypeDescription.Generic typeVariable) Returns the parameter binding of the supplied type variable.Returns the display name of this element as it is found in the source code.Returns the component type of this type.Returns the fields that this type declares.Returns the methods that this type declares.Returns the interfaces that this type implements.Returns the lower bounds of this type.Returns the list of record components that are declared by this type.getSort()
Returns the sort of the generic type this instance represents.Returns the size of the type described by this instance.Returns the super class of this type.Returns the symbol of this type variable.Returns the name of the type.Returns the source of this type variable.Returns the upper bounds of this type.int
hashCode()
boolean
isArray()
Checks if the type described by this entity is an array.boolean
Checks if the type described by this entity is a primitive type.boolean
isRecord()
Checks if this type is a Java record.iterator()
boolean
represents
(Type type) Checks if the type described by this instance representstype
.toString()
Methods inherited from class net.bytebuddy.description.type.TypeDescription.Generic.AbstractBase
asGenericType, asRawType, getModifiers
Methods inherited from class net.bytebuddy.description.ModifierReviewable.AbstractBase
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
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface net.bytebuddy.description.annotation.AnnotationSource
getDeclaredAnnotations
Methods inherited from interface java.lang.Iterable
forEach, spliterator
Methods inherited from interface net.bytebuddy.description.ModifierReviewable
getSyntheticState, isFinal, isSynthetic
Methods inherited from interface net.bytebuddy.description.ModifierReviewable.ForTypeDefinition
getTypeManifestation, isAnnotation, isInterface
Methods inherited from interface net.bytebuddy.description.ModifierReviewable.OfAbstraction
isAbstract
Methods inherited from interface net.bytebuddy.description.ModifierReviewable.OfByteCodeElement
getOwnership, getVisibility, isDeprecated, isPackagePrivate, isPrivate, isProtected, isPublic, isStatic
Methods inherited from interface net.bytebuddy.description.ModifierReviewable.OfEnumeration
getEnumerationState, isEnum
Methods inherited from interface net.bytebuddy.description.type.TypeDefinition
asErasure
Methods inherited from interface net.bytebuddy.description.type.TypeDescription.Generic
getOwnerType, getTypeArguments
-
Constructor Details
-
OfParameterizedType
public OfParameterizedType()
-
-
Method Details
-
getSort
Returns the sort of the generic type this instance represents.- Returns:
- The sort of the generic type.
-
getSuperClass
Returns the super class of this type. A super type is only defined for non-generic types (TypeDefinition.Sort.NON_GENERIC
), parameterized types (TypeDefinition.Sort.PARAMETERIZED
) or generic array types (TypeDefinition.Sort.GENERIC_ARRAY
) types. Interface types and theObject
class do not define a super class wherenull
is returned. Array types defineObject
as their direct super class.- Returns:
- The super class of this type or
null
if no super class exists for this type.
-
getInterfaces
Returns the interfaces that this type implements. A super type is only defined for non-generic types (TypeDefinition.Sort.NON_GENERIC
), parameterized types (TypeDefinition.Sort.PARAMETERIZED
) or generic array types (TypeDefinition.Sort.GENERIC_ARRAY
) types.- Returns:
- The interfaces that this type implements.
-
getDeclaredFields
Returns the fields that this type declares. A super type is only defined for non-generic types (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.- Returns:
- The fields that this type declares. A super type is only defined for non-generic 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.
-
getDeclaredMethods
Returns the methods that this type declares.- Returns:
- The methods that this type declares.
-
getRecordComponents
Returns the list of record components that are declared by this type. If this type is not a record, the returned list is empty.- Returns:
- A list of record components that this type declares.
-
findBindingOf
Returns the parameter binding of the supplied type variable.
This method must only be called for parameterized types (
TypeDefinition.Sort.PARAMETERIZED
). For all other types, this method throws anIllegalStateException
.- Parameters:
typeVariable
- The type variable for which a value should be located.- Returns:
- The value that is bound to the supplied type variable or
null
if the type variable is not bound by this parameterized type.
-
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, anIllegalStateException
is thrown.- Returns:
- The upper bounds of this type.
-
getLowerBounds
Returns the lower bounds of this type.
Only wildcard types (
TypeDefinition.Sort.WILDCARD
) define a lower bound. For other types, anIllegalStateException
is thrown.- Returns:
- The lower bounds of this type.
-
getComponentType
Returns the component type of this type.
Only non-generic types (
TypeDefinition.Sort.NON_GENERIC
) and generic array typesTypeDefinition.Sort.GENERIC_ARRAY
) define a component type. For other types, anIllegalStateException
is thrown.- Returns:
- The component type of this type or
null
if this type does not represent an array type.
-
getTypeVariableSource
Returns the source of this type variable. A type variable source is only well-defined for an attached type variable (TypeDefinition.Sort.VARIABLE
. For other types, this method throws anIllegalStateException
.- Returns:
- This type's type variable source.
-
getSymbol
Returns the symbol of this type variable. A symbol is only well-defined for type variables (TypeDefinition.Sort.VARIABLE
,TypeDefinition.Sort.VARIABLE_SYMBOLIC
). For other types, this method throws anIllegalStateException
.- Returns:
- This type's type variable symbol.
-
getTypeName
Returns the name of the type. For generic types, this name is theirObject.toString()
representations. For a non-generic type, it is the fully qualified binary name of the type.- Returns:
- The name of this type.
-
getActualName
Returns the display name of this element as it is found in the source code. If no such name exists, an empty string is returned.- Returns:
- The name of this element as given in a Java program's source code.
-
isPrimitive
public boolean isPrimitive()Checks if the type described by this entity is a primitive type.- Returns:
true
if this type description represents a primitive type.
-
isArray
public boolean isArray()Checks if the type described by this entity is an array.- Returns:
true
if this type description represents an array.
-
isRecord
public boolean isRecord()Checks if this type is a Java record.- Returns:
true
if this type is a Java record.
-
represents
Checks if the type described by this instance representstype
.- Specified by:
represents
in interfaceTypeDefinition
- Overrides:
represents
in classTypeDescription.Generic.AbstractBase
- Parameters:
type
- The type of interest.- Returns:
true
if the type described by this instance representstype
.
-
iterator
-
accept
Applies a visitor to this generic type description.- Type Parameters:
T
- The value that this visitor yields.- Parameters:
visitor
- The visitor to apply.- Returns:
- The visitor's return value.
-
getStackSize
Returns the size of the type described by this instance. Wildcard types (TypeDefinition.Sort.WILDCARD
do not have a well-defined a stack size and cause anIllegalStateException
to be thrown.- Returns:
- The size of the type described by this instance.
-
hashCode
-
equals
-
toString
-