Interface InstrumentedType.WithFlexibleName

    • Method Detail

      • withModifiers

        InstrumentedType.WithFlexibleName withModifiers​(int modifiers)
        Creates a new instrumented type with changed modifiers.
        Specified by:
        withModifiers in interface InstrumentedType
        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

        InstrumentedType.WithFlexibleName withInterfaces​(TypeList.Generic interfaceTypes)
        Creates a new instrumented type with the given interfaces implemented.
        Specified by:
        withInterfaces in interface InstrumentedType
        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

        InstrumentedType.WithFlexibleName withNestHost​(TypeDescription nestHost)
        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:
        withNestHost in interface InstrumentedType
        Parameters:
        nestHost - The nest host of the created instrumented type.
        Returns:
        A new instrumented type with the supplied type as its nest host.
      • withNestMembers

        InstrumentedType.WithFlexibleName withNestMembers​(TypeList nestMembers)
        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:
        withNestMembers in interface InstrumentedType
        Parameters:
        nestMembers - The nest members to add to the created instrumented type.
        Returns:
        A new instrumented type that applies the supplied nest members.
      • withEnclosingType

        InstrumentedType.WithFlexibleName withEnclosingType​(TypeDescription enclosingType)
        Creates a new instrumented type with the supplied enclosing type.
        Specified by:
        withEnclosingType in interface InstrumentedType
        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.
      • withDeclaredTypes

        InstrumentedType.WithFlexibleName withDeclaredTypes​(TypeList declaredTypes)
        Creates a new instrumented type that indicates that it declared the supplied types.
        Specified by:
        withDeclaredTypes in interface InstrumentedType
        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

        InstrumentedType.WithFlexibleName withPermittedSubclasses​(TypeList permittedSubclasses)
        Creates a new instrumented type that includes the supplied permitted subclasses.
        Specified by:
        withPermittedSubclasses in interface InstrumentedType
        Parameters:
        permittedSubclasses - A list of permitted subclasses to include.
        Returns:
        A new instrumented type that includes the supplied permitted subclasses.
      • withLocalClass

        InstrumentedType.WithFlexibleName withLocalClass​(boolean localClass)
        Creates a new instrumented type that indicates that is defined as a local class. Setting this property resets the anonymous class property.
        Specified by:
        withLocalClass in interface InstrumentedType
        Parameters:
        localClass - true if 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

        InstrumentedType.WithFlexibleName withAnonymousClass​(boolean anonymousClass)
        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:
        withAnonymousClass in interface InstrumentedType
        Parameters:
        anonymousClass - true if 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

        InstrumentedType.WithFlexibleName withRecord​(boolean record)
        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:
        withRecord in interface InstrumentedType
        Parameters:
        record - true if the instrumented type is supposed to be a record.
        Returns:
        A new instrumented type that is defined as a record.
      • withSealed

        InstrumentedType.WithFlexibleName withSealed​(boolean sealed)
        Creates a new instrumented type that indicates that it defined as a sealed type.
        Specified by:
        withSealed in interface InstrumentedType
        Parameters:
        sealed - true if the instrumented type is supposed to be sealed.
        Returns:
        A new instrumented type that is defined as a sealed type if any permitted subclasses are set.
      • withTypeVariable

        InstrumentedType.WithFlexibleName withTypeVariable​(TypeVariableToken typeVariable)
        Creates a new instrumented type with the given type variable defined.
        Specified by:
        withTypeVariable in interface InstrumentedType
        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​(java.util.List<? extends AnnotationDescription> annotationDescriptions)
        Creates a new instrumented type with the given annotations.
        Specified by:
        withAnnotations in interface InstrumentedType
        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

        InstrumentedType.WithFlexibleName withInitializer​(ByteCodeAppender byteCodeAppender)
        Creates a new instrumented type that executes the given initializer in the instrumented type's type initializer.
        Specified by:
        withInitializer in interface InstrumentedType
        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

        InstrumentedType.WithFlexibleName withName​(java.lang.String name)
        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.