Class TypeDescription.Generic.OfTypeVariable.Symbolic
- java.lang.Object
-
- net.bytebuddy.description.ModifierReviewable.AbstractBase
-
- net.bytebuddy.description.type.TypeDescription.Generic.AbstractBase
-
- net.bytebuddy.description.type.TypeDescription.Generic.OfTypeVariable.Symbolic
-
- All Implemented Interfaces:
java.lang.Iterable<TypeDefinition>,AnnotationSource,ModifierReviewable,ModifierReviewable.ForFieldDescription,ModifierReviewable.ForMethodDescription,ModifierReviewable.ForParameterDescription,ModifierReviewable.ForTypeDefinition,ModifierReviewable.OfAbstraction,ModifierReviewable.OfByteCodeElement,ModifierReviewable.OfEnumeration,NamedElement,TypeDefinition,TypeDescription.Generic
- Enclosing class:
- TypeDescription.Generic.OfTypeVariable
public static class TypeDescription.Generic.OfTypeVariable.Symbolic extends TypeDescription.Generic.AbstractBase
Implementation of a symbolic type variable.
-
-
Nested Class Summary
-
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.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.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, OBJECT, UNDEFINED, VOID
-
-
Constructor Summary
Constructors Constructor Description Symbolic(java.lang.String symbol, AnnotationSource annotationSource)Creates a symbolic type variable.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description <T> Taccept(TypeDescription.Generic.Visitor<T> visitor)Applies a visitor to this generic type description.TypeDescriptionasErasure()Returns the erasure of this type.booleanequals(java.lang.Object other)TypeDescription.GenericfindBindingOf(TypeDescription.Generic typeVariable)Returns the parameter binding of the supplied type variable.java.lang.StringgetActualName()Returns the name of this element as it is found in the source code.TypeDescription.GenericgetComponentType()Returns the component type of this type.AnnotationListgetDeclaredAnnotations()Returns a list of annotations that are declared by this instance.FieldList<FieldDescription.InGenericShape>getDeclaredFields()Returns the fields that this type declares.MethodList<MethodDescription.InGenericShape>getDeclaredMethods()Returns the methods that this type declares.TypeList.GenericgetInterfaces()Returns the interfaces that this type implements.TypeList.GenericgetLowerBounds()Returns the lower bounds of this type.TypeDescription.GenericgetOwnerType()Returns the owner type of this type.TypeDefinition.SortgetSort()Returns the sort of the generic type this instance represents.StackSizegetStackSize()Returns the size of the type described by this instance.TypeDescription.GenericgetSuperClass()Returns the super class of this type.java.lang.StringgetSymbol()Returns the symbol of this type variable.TypeList.GenericgetTypeArguments()Returns the type arguments of this type.java.lang.StringgetTypeName()Returns the name of the type.TypeVariableSourcegetTypeVariableSource()Returns the source of this type variable.TypeList.GenericgetUpperBounds()Returns the upper bounds of this type.inthashCode()booleanisArray()Checks if the type described by this entity is an array.booleanisPrimitive()Checks if the type described by this entity is a primitive type.java.util.Iterator<TypeDefinition>iterator()booleanrepresents(java.lang.reflect.Type type)Checks if the type described by this instance representstype.java.lang.StringtoString()-
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.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
-
-
-
-
Constructor Detail
-
Symbolic
public Symbolic(java.lang.String symbol, AnnotationSource annotationSource)Creates a symbolic type variable.- Parameters:
symbol- The symbol of the symbolic type variable.annotationSource- The annotation source to query for the declared annotations.
-
-
Method Detail
-
getSort
public TypeDefinition.Sort getSort()
Description copied from interface:TypeDefinitionReturns the sort of the generic type this instance represents.- Returns:
- The sort of the generic type.
-
getSymbol
public java.lang.String getSymbol()
Description copied from interface:TypeDescription.GenericReturns 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.
-
getDeclaredAnnotations
public AnnotationList getDeclaredAnnotations()
Description copied from interface:AnnotationSourceReturns a list of annotations that are declared by this instance.- Returns:
- A list of declared annotations.
-
asErasure
public TypeDescription asErasure()
Description copied from interface:TypeDefinitionReturns the erasure of this type. Wildcard types (TypeDefinition.Sort.WILDCARD) do not have a well-defined erasure and cause anIllegalStateExceptionto be thrown.- Returns:
- The erasure of this type.
-
getUpperBounds
public TypeList.Generic getUpperBounds()
Description copied from interface:TypeDescription.GenericReturns 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, anIllegalStateExceptionis thrown.- Returns:
- The upper bounds of this type.
-
getTypeVariableSource
public TypeVariableSource getTypeVariableSource()
Description copied from interface:TypeDescription.GenericReturns 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.
-
getSuperClass
public TypeDescription.Generic getSuperClass()
Description copied from interface:TypeDefinitionReturns 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 theObjectclass do not define a super class wherenullis returned. Array types defineObjectas their direct super class.- Returns:
- The super class of this type or
nullif no super class exists for this type.
-
getInterfaces
public TypeList.Generic getInterfaces()
Description copied from interface:TypeDefinitionReturns 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
public FieldList<FieldDescription.InGenericShape> getDeclaredFields()
Description copied from interface:TypeDefinitionReturns 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
public MethodList<MethodDescription.InGenericShape> getDeclaredMethods()
Description copied from interface:TypeDefinitionReturns the methods that this type declares.- Returns:
- The methods that this type declares.
-
getComponentType
public TypeDescription.Generic getComponentType()
Description copied from interface:TypeDefinitionReturns 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, anIllegalStateExceptionis thrown.- Returns:
- The component type of this type or
nullif this type does not represent an array type.
-
getTypeArguments
public TypeList.Generic getTypeArguments()
Description copied from interface:TypeDescription.GenericReturns the type arguments of this type.
Parameters are only well-defined for parameterized types (
TypeDefinition.Sort.PARAMETERIZED). For all other types, this method throws anIllegalStateException.- Returns:
- A list of this type's type parameters.
-
findBindingOf
public TypeDescription.Generic findBindingOf(TypeDescription.Generic typeVariable)
Description copied from interface:TypeDescription.GenericReturns 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
nullif the type variable is not bound by this parameterized type.
-
getLowerBounds
public TypeList.Generic getLowerBounds()
Description copied from interface:TypeDescription.GenericReturns the lower bounds of this type.
Only wildcard types (
TypeDefinition.Sort.WILDCARD) define a lower bound. For other types, anIllegalStateExceptionis thrown.- Returns:
- The lower bounds of this type.
-
getOwnerType
public TypeDescription.Generic getOwnerType()
Description copied from interface:TypeDescription.GenericReturns the owner type of this type. A type's owner type describes a nested type's declaring type. If it exists, the returned type can be a non-generic or parameterized type. If a class has no declaring type,
nullis returned.An owner type is only well-defined for parameterized types (
TypeDefinition.Sort.PARAMETERIZED), for non-generic types (TypeDefinition.Sort.NON_GENERIC) and for generic arrays (TypeDefinition.Sort.GENERIC_ARRAY). For all other types, this method throws anIllegalStateException.- Returns:
- This type's owner type or
nullif no owner type exists.
-
getTypeName
public java.lang.String getTypeName()
Description copied from interface:TypeDefinitionReturns 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
public java.lang.String getActualName()
Description copied from interface:NamedElementReturns the 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.
-
accept
public <T> T accept(TypeDescription.Generic.Visitor<T> visitor)
Description copied from interface:TypeDescription.GenericApplies 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
public StackSize getStackSize()
Description copied from interface:TypeDefinitionReturns the size of the type described by this instance. Wildcard types (TypeDefinition.Sort.WILDCARDdo not have a well-defined a stack size and cause anIllegalStateExceptionto be thrown.- Returns:
- The size of the type described by this instance.
-
isArray
public boolean isArray()
Description copied from interface:TypeDefinitionChecks if the type described by this entity is an array.- Returns:
trueif this type description represents an array.
-
isPrimitive
public boolean isPrimitive()
Description copied from interface:TypeDefinitionChecks if the type described by this entity is a primitive type.- Returns:
trueif this type description represents a primitive type.
-
represents
public boolean represents(java.lang.reflect.Type type)
Description copied from interface:TypeDefinitionChecks if the type described by this instance representstype.- Specified by:
representsin interfaceTypeDefinition- Overrides:
representsin classTypeDescription.Generic.AbstractBase- Parameters:
type- The type of interest.- Returns:
trueif the type described by this instance representstype.
-
iterator
public java.util.Iterator<TypeDefinition> iterator()
-
hashCode
public int hashCode()
- Overrides:
hashCodein classjava.lang.Object
-
equals
public boolean equals(java.lang.Object other)
- Overrides:
equalsin classjava.lang.Object
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
-