Package net.bytebuddy.implementation
Class MethodCall.FieldSetting
java.lang.Object
net.bytebuddy.implementation.MethodCall.FieldSetting
- All Implemented Interfaces:
InstrumentedType.Prepareable
,Implementation
,Implementation.Composable
- Enclosing class:
- MethodCall
@Enhance
public static class MethodCall.FieldSetting
extends Object
implements Implementation.Composable
A
MethodCall
that sets the call's result as the value of a field.-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprotected static enum
A byte code appender to implement a field-setting method call.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
Fields -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotected
FieldSetting
(MethodCall methodCall) Creates a new field setting method call. -
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.withAssigner
(Assigner assigner, Assigner.Typing typing) Defines an assigner to be used for assigning values to the parameters of the invoked method.
-
Field Details
-
methodCall
The represented method call.
-
-
Constructor Details
-
FieldSetting
Creates a new field setting method call.- Parameters:
methodCall
- The represented method call.
-
-
Method Details
-
withAssigner
Defines an assigner to be used for assigning values to the parameters of the invoked method. This assigner is also used for assigning the invoked method's return value to the field being set.- Parameters:
assigner
- The assigner to use.typing
- Indicates if dynamic type castings should be attempted for incompatible assignments.- Returns:
- This field-setting method call using the provided assigner.
-
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.
-