Interface InstrumentedType

    • Method Detail

      • withField

        InstrumentedType withField​(FieldDescription.Token token)
        Creates a new instrumented type that includes a new field.
        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 withMethod​(MethodDescription.Token token)
        Creates a new instrumented type that includes a new method or constructor.
        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 withModifiers​(int modifiers)
        Creates a new instrumented type with changed modifiers.
        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 withInterfaces​(TypeList.Generic interfaceTypes)
        Creates a new instrumented type with the given interfaces implemented.
        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.
      • withTypeVariable

        InstrumentedType withTypeVariable​(TypeVariableToken typeVariable)
        Creates a new instrumented type with the given type variable defined.
        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 withAnnotations​(java.util.List<? extends AnnotationDescription> annotationDescriptions)
        Creates a new instrumented type with the given annotations.
        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 withInitializer​(LoadedTypeInitializer loadedTypeInitializer)
        Creates a new instrumented type that includes the given LoadedTypeInitializer.
        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

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

        LoadedTypeInitializer getLoadedTypeInitializer()
        Returns the LoadedTypeInitializers that were registered for this instrumented type.
        Returns:
        The registered loaded type initializers for this instrumented type.
      • getTypeInitializer

        TypeInitializer getTypeInitializer()
        Returns this instrumented type's type initializer.
        Returns:
        This instrumented type's type initializer.
      • validated

        TypeDescription validated()
        Validates the instrumented type to define a legal Java type.
        Returns:
        This instrumented type as a non-modifiable type description.