Package com.linecorp.armeria.common
Interface ContextAwareBiConsumer<T,U>
- All Superinterfaces:
BiConsumer<T,
,U> ContextHolder
A delegating
BiConsumer
that makes sure an underlying BiConsumer is
executed within the RequestContext
.-
Method Summary
Modifier and TypeMethodDescriptioncontext()
Returns theRequestContext
that was specified when creating thisContextAwareBiConsumer
.static <T,
U> ContextAwareBiConsumer <T, U> of
(RequestContext context, BiConsumer<T, U> action) Returns a newContextAwareBiConsumer
that sets the specifiedRequestContext
before executing an underlyingBiConsumer
.BiConsumer
<T, U> Returns theBiConsumer
that's executed without setting theRequestContext
.Methods inherited from interface java.util.function.BiConsumer
accept, andThen
-
Method Details
-
of
Returns a newContextAwareBiConsumer
that sets the specifiedRequestContext
before executing an underlyingBiConsumer
. -
context
RequestContext context()Returns theRequestContext
that was specified when creating thisContextAwareBiConsumer
.- Specified by:
context
in interfaceContextHolder
-
withoutContext
BiConsumer<T,U> withoutContext()Returns theBiConsumer
that's executed without setting theRequestContext
.
-