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.
  • Field Details

    • methodCall

      private final MethodCall methodCall
      The represented method call.
  • Constructor Details

    • FieldSetting

      protected FieldSetting(MethodCall methodCall)
      Creates a new field setting method call.
      Parameters:
      methodCall - The represented method call.
  • Method Details

    • withAssigner

      public Implementation.Composable withAssigner(Assigner assigner, Assigner.Typing typing)
      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

      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.