Interface InstrumentedType.WithFlexibleName
- All Superinterfaces:
AnnotationSource, ByteCodeElement, DeclaredByType, InstrumentedType, Iterable<TypeDefinition>, ModifierReviewable, ModifierReviewable.ForTypeDefinition, ModifierReviewable.OfAbstraction, ModifierReviewable.OfByteCodeElement, ModifierReviewable.OfEnumeration, NamedElement, NamedElement.WithDescriptor, NamedElement.WithRuntimeName, TypeDefinition, TypeDescription, TypeVariableSource
- All Known Implementing Classes:
InstrumentedType.Default, InstrumentedType.Frozen
- Enclosing interface:
InstrumentedType
Implementations represent an
InstrumentedType with a flexible name.-
Nested Class Summary
Nested classes/interfaces inherited from interface AnnotationSource
AnnotationSource.Empty, AnnotationSource.ExplicitNested classes/interfaces inherited from interface ByteCodeElement
ByteCodeElement.Member, ByteCodeElement.Token<T>, ByteCodeElement.TypeDependant<T,S> Nested classes/interfaces inherited from interface DeclaredByType
DeclaredByType.WithMandatoryDeclarationNested classes/interfaces inherited from interface InstrumentedType
InstrumentedType.Default, InstrumentedType.Factory, InstrumentedType.Frozen, InstrumentedType.Prepareable, InstrumentedType.WithFlexibleNameNested classes/interfaces inherited from interface ModifierReviewable
ModifierReviewable.ForFieldDescription, ModifierReviewable.ForMethodDescription, ModifierReviewable.ForModuleDescription, ModifierReviewable.ForModuleRequirement, ModifierReviewable.ForParameterDescription, ModifierReviewable.ForTypeDefinition, ModifierReviewable.OfAbstraction, ModifierReviewable.OfByteCodeElement, ModifierReviewable.OfEnumeration, ModifierReviewable.OfMandatableNested classes/interfaces inherited from interface NamedElement
NamedElement.WithDescriptor, NamedElement.WithGenericName, NamedElement.WithOptionalName, NamedElement.WithRuntimeNameNested classes/interfaces inherited from interface TypeDefinition
TypeDefinition.Sort, TypeDefinition.SuperClassIteratorNested classes/interfaces inherited from interface TypeDescription
TypeDescription.AbstractBase, TypeDescription.ArrayProjection, TypeDescription.ForLoadedType, TypeDescription.ForPackageDescription, TypeDescription.Generic, TypeDescription.Latent, TypeDescription.LazyProxy, TypeDescription.SuperTypeLoadingNested classes/interfaces inherited from interface TypeVariableSource
TypeVariableSource.Visitor<T> -
Field Summary
Fields inherited from interface ModifierReviewable
EMPTY_MASKFields inherited from interface NamedElement
EMPTY_NAME, NO_NAMEFields inherited from interface NamedElement.WithDescriptor
NON_GENERIC_SIGNATUREFields inherited from interface TypeDefinition
RAW_TYPES_PROPERTYFields inherited from interface TypeDescription
ARRAY_INTERFACES, CLASS, OBJECT, STRING, THROWABLE, UNDEFINED, VOID -
Method Summary
Modifier and TypeMethodDescriptionwithAnnotations(List<? extends AnnotationDescription> annotationDescriptions) Creates a new instrumented type with the given annotations.withAnonymousClass(boolean anonymousClass) Creates a new instrumented type that indicates that it is defined as an anonymous class.withAuxiliaryField(FieldDescription.Token token, Object value) Creates a new instrumented type that includes a new field.withDeclaredTypes(TypeList declaredTypes) Creates a new instrumented type that indicates that it declared the supplied types.withDeclaringType(TypeDescription declaringType) Creates a new instrumented type that is declared by the supplied type.withEnclosingMethod(MethodDescription.InDefinedShape enclosingMethod) Creates a new instrumented type with the supplied enclosing method.withEnclosingType(TypeDescription enclosingType) Creates a new instrumented type with the supplied enclosing type.withField(FieldDescription.Token token) Creates a new instrumented type that includes a new field.withInitializer(ByteCodeAppender byteCodeAppender) Creates a new instrumented type that executes the given initializer in the instrumented type's type initializer.withInitializer(LoadedTypeInitializer loadedTypeInitializer) Creates a new instrumented type that includes the givenLoadedTypeInitializer.withInterfaces(TypeList.Generic interfaceTypes) Creates a new instrumented type with the given interfaces implemented.withLocalClass(boolean localClass) Creates a new instrumented type that indicates that is defined as a local class.Creates a new instrumented type that includes a new method or constructor.withModifiers(int modifiers) Creates a new instrumented type with changed modifiers.withModuleDescription(ModuleDescription moduleDescription) Creates a new instrumented type that defines the provided module metadata or no such metadata ifnullis provided.Creates a new instrumented type with a changed name.withNestHost(TypeDescription nestHost) Creates a new instrumented type with the supplied nest host.withNestMembers(TypeList nestMembers) Creates a new instrumented types with the supplied nest members added to this instrumented type.withPermittedSubclasses(TypeList permittedSubclasses) Creates a new instrumented type that includes the supplied permitted subclasses or unseals the type.withRecord(boolean record) Creates a new instrumented type that indicates that it defined as a record type.Creates a new instrumented type that includes a new record component.withTypeVariable(TypeVariableToken typeVariable) Creates a new instrumented type with the given type variable defined.withTypeVariables(ElementMatcher<? super TypeDescription.Generic> matcher, Transformer<TypeVariableToken> transformer) Applies a transformation onto all existing type variables of this instrumented type.Methods inherited from interface AnnotationSource
getDeclaredAnnotationsMethods inherited from interface ByteCodeElement
isAccessibleTo, isVisibleToMethods inherited from interface InstrumentedType
getLoadedTypeInitializer, getTypeInitializer, validatedMethods inherited from interface Iterable
forEach, iterator, spliteratorMethods inherited from interface ModifierReviewable
getModifiers, getSyntheticState, isFinal, isSyntheticMethods inherited from interface ModifierReviewable.ForTypeDefinition
getTypeManifestation, isAnnotation, isInterfaceMethods inherited from interface ModifierReviewable.OfAbstraction
isAbstractMethods inherited from interface ModifierReviewable.OfByteCodeElement
getOwnership, getVisibility, isDeprecated, isPackagePrivate, isPrivate, isProtected, isPublic, isStaticMethods inherited from interface ModifierReviewable.OfEnumeration
getEnumerationState, isEnumMethods inherited from interface NamedElement
getActualNameMethods inherited from interface NamedElement.WithDescriptor
getDescriptor, getGenericSignatureMethods inherited from interface NamedElement.WithRuntimeName
getInternalName, getNameMethods inherited from interface TypeDefinition
asErasure, asGenericType, getInterfaces, getSort, getStackSize, getSuperClass, getTypeName, isArray, isPrimitive, isRecord, representsMethods inherited from interface TypeDescription
asBoxed, asUnboxed, getActualModifiers, getCanonicalName, getClassFileVersion, getComponentType, getDeclaredFields, getDeclaredMethods, getDeclaredTypes, getDeclaringType, getDefaultValue, getEnclosingMethod, getEnclosingType, getInheritedAnnotations, getInnerClassCount, getLongSimpleName, getNestHost, getNestMembers, getPackage, getPermittedSubtypes, getRecordComponents, getSimpleName, isAnnotationReturnType, isAnnotationValue, isAnnotationValue, isAnonymousType, isAssignableFrom, isAssignableFrom, isAssignableTo, isAssignableTo, isCompileTimeConstant, isInHierarchyWith, isInHierarchyWith, isInnerClass, isInstance, isLocalType, isMemberType, isModuleType, isNestedClass, isNestHost, isNestMateOf, isNestMateOf, isPackageType, isPrimitiveWrapper, isSamePackage, isSealed, toModuleDescriptionMethods inherited from interface TypeVariableSource
accept, findExpectedVariable, findVariable, getEnclosingSource, getTypeVariables, isGenerified, isInferrable
-
Method Details
-
withModuleDescription
InstrumentedType.WithFlexibleName withModuleDescription(@MaybeNull ModuleDescription moduleDescription) Creates a new instrumented type that defines the provided module metadata or no such metadata ifnullis provided.- Specified by:
withModuleDescriptionin interfaceInstrumentedType- Parameters:
moduleDescription- The metadata to include ornull.- Returns:
- A new instrumented type that is equal to this instrumented type but with adjusted module metadata.
-
withField
Creates a new instrumented type that includes a new field.- Specified by:
withFieldin interfaceInstrumentedType- Parameters:
token- A token that represents the field's shape.- Returns:
- A new instrumented type that is equal to this instrumented type but with the additional field.
-
withAuxiliaryField
Creates a new instrumented type that includes a new field.- Specified by:
withAuxiliaryFieldin interfaceInstrumentedType- Parameters:
token- A token that represents the field's shape.value- The value that this assigned to this field.- Returns:
- A new instrumented type that is equal to this instrumented type but with the additional field.
-
withMethod
Creates a new instrumented type that includes a new method or constructor.- Specified by:
withMethodin interfaceInstrumentedType- Parameters:
token- A token that represents the method's shape.- Returns:
- A new instrumented type that is equal to this instrumented type but with the additional method.
-
withRecordComponent
Creates a new instrumented type that includes a new record component.- Specified by:
withRecordComponentin interfaceInstrumentedType- Parameters:
token- A token that represents the record component's shape.- Returns:
- A new instrumented type that is equal to this instrumented type but with the additional record component.
-
withModifiers
Creates a new instrumented type with changed modifiers.- Specified by:
withModifiersin interfaceInstrumentedType- Parameters:
modifiers- The instrumented type's modifiers.- Returns:
- A new instrumented type that is equal to this instrumented type but with the given modifiers.
-
withInterfaces
Creates a new instrumented type with the given interfaces implemented.- Specified by:
withInterfacesin interfaceInstrumentedType- Parameters:
interfaceTypes- The interface types to implement.- Returns:
- A new instrumented type that is equal to this instrumented type but with the given interfaces implemented.
-
withNestHost
Creates a new instrumented type with the supplied nest host. An instrumented type can be its own nest host. Setting a nest host removes all nest members from the instrumented type.- Specified by:
withNestHostin interfaceInstrumentedType- Parameters:
nestHost- The nest host of the created instrumented type.- Returns:
- A new instrumented type with the supplied type as its nest host.
-
withNestMembers
Creates a new instrumented types with the supplied nest members added to this instrumented type. The instrumented type is defined as a nest host if this method is invoked. Any previous nest members are prepended to the supplied types.- Specified by:
withNestMembersin interfaceInstrumentedType- Parameters:
nestMembers- The nest members to add to the created instrumented type.- Returns:
- A new instrumented type that applies the supplied nest members.
-
withEnclosingType
Creates a new instrumented type with the supplied enclosing type.- Specified by:
withEnclosingTypein interfaceInstrumentedType- Parameters:
enclosingType- The type to define as the created instrumented type's enclosing type.- Returns:
- A new instrumented type with the supplied type as its enclosing type.
-
withEnclosingMethod
InstrumentedType.WithFlexibleName withEnclosingMethod(MethodDescription.InDefinedShape enclosingMethod) Creates a new instrumented type with the supplied enclosing method.- Specified by:
withEnclosingMethodin interfaceInstrumentedType- Parameters:
enclosingMethod- The method to define as the created instrumented type's enclosing method.- Returns:
- A new instrumented type with the supplied method as its enclosing method.
-
withDeclaringType
Creates a new instrumented type that is declared by the supplied type.- Specified by:
withDeclaringTypein interfaceInstrumentedType- Parameters:
declaringType- The type that declares the instrumented type ornullif no such type exists.- Returns:
- A new instrumented type that is declared by the instrumented type.
-
withDeclaredTypes
Creates a new instrumented type that indicates that it declared the supplied types.- Specified by:
withDeclaredTypesin interfaceInstrumentedType- Parameters:
declaredTypes- The types to add to the created instrumented type as declared types.- Returns:
- A new instrumented type that indicates that it has declared the supplied types.
-
withPermittedSubclasses
Creates a new instrumented type that includes the supplied permitted subclasses or unseals the type.- Specified by:
withPermittedSubclassesin interfaceInstrumentedType- Parameters:
permittedSubclasses- A list of permitted subclasses to include ornullto unseal the type.- Returns:
- A new instrumented type that includes the supplied permitted subclasses or unseals the type.
-
withLocalClass
Creates a new instrumented type that indicates that is defined as a local class. Setting this property resets the anonymous class property.- Specified by:
withLocalClassin interfaceInstrumentedType- Parameters:
localClass-trueif the instrumented type is supposed to be treated as a local class.- Returns:
- A new instrumented type that is treated as a local class.
-
withAnonymousClass
Creates a new instrumented type that indicates that it is defined as an anonymous class. Setting this property resets the local class property.- Specified by:
withAnonymousClassin interfaceInstrumentedType- Parameters:
anonymousClass-trueif the instrumented type is supposed to be treated as an anonymous class.- Returns:
- A new instrumented type that is treated as an anonymous class.
-
withRecord
Creates a new instrumented type that indicates that it defined as a record type. Setting this property to false removes all record components.- Specified by:
withRecordin interfaceInstrumentedType- Parameters:
record-trueif the instrumented type is supposed to be a record.- Returns:
- A new instrumented type that is defined as a record.
-
withTypeVariable
Creates a new instrumented type with the given type variable defined.- Specified by:
withTypeVariablein interfaceInstrumentedType- Parameters:
typeVariable- The type variable to declare.- Returns:
- A new instrumented type that is equal to this instrumented type but with the given type variable declared.
-
withAnnotations
InstrumentedType.WithFlexibleName withAnnotations(List<? extends AnnotationDescription> annotationDescriptions) Creates a new instrumented type with the given annotations.- Specified by:
withAnnotationsin interfaceInstrumentedType- Parameters:
annotationDescriptions- The annotations to add to the instrumented type.- Returns:
- A new instrumented type that is equal to this instrumented type but annotated with the given annotations
-
withInitializer
Creates a new instrumented type that includes the givenLoadedTypeInitializer.- Specified by:
withInitializerin interfaceInstrumentedType- Parameters:
loadedTypeInitializer- The type initializer to include.- Returns:
- A new instrumented type that is equal to this instrumented type but with the additional type initializer.
-
withInitializer
Creates a new instrumented type that executes the given initializer in the instrumented type's type initializer.- Specified by:
withInitializerin interfaceInstrumentedType- Parameters:
byteCodeAppender- The byte code to add to the type initializer.- Returns:
- A new instrumented type that is equal to this instrumented type but with the given stack manipulation attached to its type initializer.
-
withName
Creates a new instrumented type with a changed name.- Parameters:
name- The name of the instrumented type.- Returns:
- A new instrumented type that has the given name.
-
withTypeVariables
InstrumentedType.WithFlexibleName withTypeVariables(ElementMatcher<? super TypeDescription.Generic> matcher, Transformer<TypeVariableToken> transformer) Applies a transformation onto all existing type variables of this instrumented type. A transformation is potentially unsafe and it is the responsibility of the supplier to return a valid type variable token from the transformer.- Parameters:
matcher- The matcher to decide what type variables to transform.transformer- The transformer to apply on all matched type variables.- Returns:
- A new instrumented type with all matched type variables transformed.
-