Interface InstrumentedType.WithFlexibleName

    • Method Detail

      • withField

        InstrumentedType.WithFlexibleName withField​(FieldDescription.Token token)
        Description copied from interface: InstrumentedType
        Creates a new instrumented type that includes a new field.
        Specified by:
        withField in interface InstrumentedType
        Parameters:
        token - A token that represents the field's shape. This token must represent types in their detached state.
        Returns:
        A new instrumented type that is equal to this instrumented type but with the additional field.
      • withMethod

        InstrumentedType.WithFlexibleName withMethod​(MethodDescription.Token token)
        Description copied from interface: InstrumentedType
        Creates a new instrumented type that includes a new method or constructor.
        Specified by:
        withMethod in interface InstrumentedType
        Parameters:
        token - A token that represents the method's shape. This token must represent types in their detached state.
        Returns:
        A new instrumented type that is equal to this instrumented type but with the additional method.
      • withModifiers

        InstrumentedType.WithFlexibleName withModifiers​(int modifiers)
        Description copied from interface: InstrumentedType
        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.
      • withAnnotations

        InstrumentedType.WithFlexibleName withAnnotations​(java.util.List<? extends AnnotationDescription> annotationDescriptions)
        Description copied from interface: InstrumentedType
        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)
        Description copied from interface: InstrumentedType
        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.