Package com.linecorp.armeria.common
Interface ContextAwareBiFunction<T,U,R>
- All Superinterfaces:
BiFunction<T,
,U, R> ContextHolder
@UnstableApi
public interface ContextAwareBiFunction<T,U,R>
extends BiFunction<T,U,R>, ContextHolder
A delegating
BiFunction
that makes sure an underlying BiFunction is
executed within the RequestContext
.-
Method Summary
Modifier and TypeMethodDescriptioncontext()
Returns theRequestContext
that was specified when creating thisContextAwareBiFunction
.static <T,
U, R> ContextAwareBiFunction<T, U, R> of
(RequestContext context, BiFunction<T, U, R> function) Returns a newContextAwareBiFunction
that sets the specifiedRequestContext
before executing an underlyingBiFunction
.BiFunction<T,
U, R> Returns theBiFunction
that's executed without setting theRequestContext
.Methods inherited from interface java.util.function.BiFunction
andThen, apply
-
Method Details
-
of
static <T,U, ContextAwareBiFunction<T,R> U, ofR> (RequestContext context, BiFunction<T, U, R> function) Returns a newContextAwareBiFunction
that sets the specifiedRequestContext
before executing an underlyingBiFunction
. -
context
RequestContext context()Returns theRequestContext
that was specified when creating thisContextAwareBiFunction
.- Specified by:
context
in interfaceContextHolder
-
withoutContext
BiFunction<T,U, withoutContext()R> Returns theBiFunction
that's executed without setting theRequestContext
.
-