Interface MutablePropagatedContext


public interface MutablePropagatedContext
Mutable propagated context will modify the internal context Intended for use-cases when the propagated context needs to be mutated and propagated later.
Since:
4.0.0
Author:
Denis Stepanov
  • Method Details

    • of

      static @NonNull MutablePropagatedContext of(@NonNull PropagatedContext propagatedContext)
      Creates a mutable propagated context with the initial context.
      Parameters:
      propagatedContext - The initial context
      Returns:
      new mutable propagated context
    • add

      @NonNull MutablePropagatedContext add(@NonNull PropagatedContextElement element)
      Modifies the context by adding an element.
      Parameters:
      element - The element element to be added
      Returns:
      the current mutable propagated context.
    • remove

      @NonNull MutablePropagatedContext remove(@NonNull PropagatedContextElement element)
      Modifies the context by removing the provided element.
      Parameters:
      element - The context element to be removed
      Returns:
      the current mutable propagated context.
    • replace

      @NonNull MutablePropagatedContext replace(@NonNull PropagatedContextElement oldElement, @NonNull PropagatedContextElement newElement)
      Modifies the context by replacing the provided element.
      Parameters:
      oldElement - The context element to be replaced
      newElement - The context element to be replaced with
      Returns:
      the current mutable propagated context.
    • getContext

      @Nullable PropagatedContext getContext()
      The mutated context.
      Returns:
      The propagated context that is being mutated.