接口 ExchangeFilterFunction
- 函数接口:
- 这是一个函数接口, 因此可用作 lambda 表达式或方法引用的赋值目标。
@FunctionalInterface public interface ExchangeFilterFunction
Represents a function that filters an exchange function.The filter is executed when a
Subscriber
subscribes to thePublisher
returned by theWebClient
.- 从以下版本开始:
- 5.0
- 作者:
- Arjen Poutsma
方法概要
所有方法 静态方法 实例方法 抽象方法 默认方法 修饰符和类型 方法 说明 default ExchangeFilterFunction
andThen(ExchangeFilterFunction afterFilter)
Return a composed filter function that first applies this filter, and then applies the given"after"
filter.default ExchangeFunction
apply(ExchangeFunction exchange)
Apply this filter to the given ExchangeFunction, resulting in a filtered exchange function.reactor.core.publisher.Mono<ClientResponse>
filter(ClientRequest request, ExchangeFunction next)
Apply this filter to the given request and exchange function.static ExchangeFilterFunction
ofRequestProcessor(Function<ClientRequest,reactor.core.publisher.Mono<ClientRequest>> processor)
Adapt the given request processor function to a filter function that only operates on theClientRequest
.static ExchangeFilterFunction
ofResponseProcessor(Function<ClientResponse,reactor.core.publisher.Mono<ClientResponse>> processor)
Adapt the given response processor function to a filter function that only operates on theClientResponse
.
方法详细资料
filter
reactor.core.publisher.Mono<ClientResponse> filter(ClientRequest request, ExchangeFunction next)
Apply this filter to the given request and exchange function.The given ExchangeFunction represents the next entity in the chain, to be invoked via invoked in order to proceed with the exchange, or not invoked to shortcut the chain.
- 参数:
request
- the current requestnext
- the next exchange function in the chain- 返回:
- the filtered response
andThen
default ExchangeFilterFunction andThen(ExchangeFilterFunction afterFilter)
Return a composed filter function that first applies this filter, and then applies the given"after"
filter.- 参数:
afterFilter
- the filter to apply after this filter- 返回:
- the composed filter
apply
default ExchangeFunction apply(ExchangeFunction exchange)
Apply this filter to the given ExchangeFunction, resulting in a filtered exchange function.- 参数:
exchange
- the exchange function to filter- 返回:
- the filtered exchange function
ofRequestProcessor
static ExchangeFilterFunction ofRequestProcessor(Function<ClientRequest,reactor.core.publisher.Mono<ClientRequest>> processor)
Adapt the given request processor function to a filter function that only operates on theClientRequest
.- 参数:
processor
- the request processor- 返回:
- the resulting filter adapter
ofResponseProcessor
static ExchangeFilterFunction ofResponseProcessor(Function<ClientResponse,reactor.core.publisher.Mono<ClientResponse>> processor)
Adapt the given response processor function to a filter function that only operates on theClientResponse
.- 参数:
processor
- the response processor- 返回:
- the resulting filter adapter