Class Implementation.Compound.Composable

java.lang.Object
net.bytebuddy.implementation.Implementation.Compound.Composable
All Implemented Interfaces:
InstrumentedType.Prepareable, Implementation, Implementation.Composable
Enclosing class:
Implementation.Compound

@Enhance public static class Implementation.Compound.Composable extends Object implements Implementation.Composable
A compound implementation that allows to combine several implementations and that is Implementation.Composable.

 

Note that the combination of two implementation might break the contract for implementing Object.equals(Object) and Object.hashCode() as described for Implementation.
See Also:
  • Field Details

    • composable

      private final Implementation.Composable composable
      The composable implementation that is applied last.
    • implementations

      private final List<Implementation> implementations
      All implementation that are represented by this compound implementation.
  • Constructor Details

    • Composable

      public Composable(Implementation implementation, Implementation.Composable composable)
      Creates a new compound composable.
      Parameters:
      implementation - An implementation that is represented by this compound implementation prior to the composable.
      composable - The composable implementation that is applied last.
    • Composable

      public Composable(List<? extends Implementation> implementations, Implementation.Composable composable)
      Creates a new compound composable.
      Parameters:
      implementations - All implementation that are represented by this compound implementation excluding the composable.
      composable - The composable implementation that is applied last.
  • Method Details

    • prepare

      public InstrumentedType prepare(InstrumentedType instrumentedType)
      Prepares a given instrumented type.
      Specified by:
      prepare in interface InstrumentedType.Prepareable
      Parameters:
      instrumentedType - The instrumented type in its current form.
      Returns:
      The prepared instrumented type.
    • appender

      public ByteCodeAppender appender(Implementation.Target implementationTarget)
      Creates a byte code appender that determines the implementation of the instrumented type's methods.
      Specified by:
      appender in interface Implementation
      Parameters:
      implementationTarget - The target of the current implementation.
      Returns:
      A byte code appender for implementing methods delegated to this implementation. This byte code appender is also responsible for handling methods that were added by this implementation on the call to InstrumentedType.Prepareable.prepare(InstrumentedType).
    • andThen

      public Implementation andThen(Implementation implementation)
      Appends the supplied implementation to this implementation.
      Specified by:
      andThen in interface Implementation.Composable
      Parameters:
      implementation - The subsequent implementation.
      Returns:
      An implementation that combines this implementation with the provided one.
    • andThen

      public Implementation.Composable andThen(Implementation.Composable implementation)
      Appends the supplied composable implementation to this implementation.
      Specified by:
      andThen in interface Implementation.Composable
      Parameters:
      implementation - The subsequent composable implementation.
      Returns:
      A composable implementation that combines this implementation with the provided one.