Class ReactorContext

java.lang.Object
dmx.fun.reactor.ReactorContext

@NullMarked public final class ReactorContext extends Object
Bridges Reactor's ContextView with dmx-fun's Option, so reading a key that may be absent yields an Option instead of throwing.

Reactor's ContextView.get(Object) throws when a key is missing; this helper models the absence explicitly as Option.none(). It introduces no hidden global state — the ContextView is always passed in by the caller (typically obtained from Mono.deferContextual).

ContextView was introduced in Reactor 3.4; these helpers therefore require Reactor 3.4 or later, even though the ReactorFun conversions work on earlier 3.x releases.

  • Method Details

    • getOrNone

      public static <T> Option<T> getOrNone(reactor.util.context.ContextView context, Object key)
      Reads key from a Reactor ContextView as an Option: Option.some(Object) when present, Option.none() when absent.
      Type Parameters:
      T - the value type stored under the key
      Parameters:
      context - the Reactor context view to read from
      key - the context key
      Returns:
      the value as an Option