Package net.bytebuddy.implementation
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:
-
Nested Class Summary
Nested classes/interfaces inherited from interface net.bytebuddy.implementation.Implementation
Implementation.Composable, Implementation.Compound, Implementation.Context, Implementation.Simple, Implementation.SpecialMethodInvocation, Implementation.Target
Nested classes/interfaces inherited from interface net.bytebuddy.dynamic.scaffold.InstrumentedType.Prepareable
InstrumentedType.Prepareable.NoOp
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final Implementation.Composable
The composable implementation that is applied last.private final List
<Implementation> All implementation that are represented by this compound implementation. -
Constructor Summary
ConstructorsConstructorDescriptionComposable
(List<? extends Implementation> implementations, Implementation.Composable composable) Creates a new compound composable.Composable
(Implementation implementation, Implementation.Composable composable) Creates a new compound composable. -
Method Summary
Modifier and TypeMethodDescriptionandThen
(Implementation implementation) Appends the supplied implementation to this implementation.andThen
(Implementation.Composable implementation) Appends the supplied composable implementation to this implementation.appender
(Implementation.Target implementationTarget) Creates a byte code appender that determines the implementation of the instrumented type's methods.prepare
(InstrumentedType instrumentedType) Prepares a given instrumented type.
-
Field Details
-
composable
The composable implementation that is applied last. -
implementations
All implementation that are represented by this compound implementation.
-
-
Constructor Details
-
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
Prepares a given instrumented type.- Specified by:
prepare
in interfaceInstrumentedType.Prepareable
- Parameters:
instrumentedType
- The instrumented type in its current form.- Returns:
- The prepared instrumented type.
-
appender
Creates a byte code appender that determines the implementation of the instrumented type's methods.- Specified by:
appender
in interfaceImplementation
- 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
Appends the supplied implementation to this implementation.- Specified by:
andThen
in interfaceImplementation.Composable
- Parameters:
implementation
- The subsequent implementation.- Returns:
- An implementation that combines this implementation with the provided one.
-
andThen
Appends the supplied composable implementation to this implementation.- Specified by:
andThen
in interfaceImplementation.Composable
- Parameters:
implementation
- The subsequent composable implementation.- Returns:
- A composable implementation that combines this implementation with the provided one.
-