T - ルーティング先のハンドラー関数の型 @FunctionalInterfaceSE public interface RouterFunction<T extends ServerResponse>
RouterFunctions| 修飾子と型 | メソッドと説明 |
|---|---|
default void | accept(RouterFunctions.Visitor visitor) 指定された訪問者を受け入れます。 |
default RouterFunction<T> | and(RouterFunction<T> other) 最初にこの関数を呼び出し、次にこのルートに結果がない場合は(同じレスポンス型 T の) other 関数を呼び出す合成ルーティング関数を返します。 |
default RouterFunction<T> | andNest(RequestPredicate predicate, RouterFunction<T> routerFunction) このルートが一致せず、指定されたリクエスト述語が適用される場合、指定されたルーター関数にルーティングする合成ルーティング関数を返します。 |
default RouterFunction<?> | andOther(RouterFunction<?> other) 最初にこの関数を呼び出し、このルートに結果がない場合は(異なるレスポンス型の) other 関数を呼び出す合成ルーティング関数を返します。 |
default RouterFunction<T> | andRoute(RequestPredicate predicate, HandlerFunction<T> handlerFunction) このルートが一致せず、指定されたリクエスト述語が適用される場合、指定されたハンドラー関数にルーティングする合成ルーティング関数を返します。 |
default <S extends ServerResponse> | filter(HandlerFilterFunction<T,S> filterFunction) |
reactor.core.publisher.Mono<HandlerFunction<T>> | route(ServerRequest request) 指定されたリクエストに一致するハンドラー関数を返します。 |
default RouterFunction<T> | withAttribute(StringSE name, ObjectSE value) 指定された属性を持つ新しいルーティング関数を返します。 |
default RouterFunction<T> | withAttributes(ConsumerSE<MapSE<StringSE, ObjectSE>> attributesConsumer) 指定されたコンシューマーで操作された属性を持つ新しいルーティング関数を返します。 |
reactor.core.publisher.Mono<HandlerFunction<T>> route(ServerRequest request)
request - ルーティングするリクエスト HandlerFunction を説明する Mono、または一致がない場合は空の Mono default RouterFunction<T> and(RouterFunction<T> other)
T の) other 関数を呼び出す合成ルーティング関数を返します。other - この関数に結果がない場合に適用する型 T の関数 other 関数を使用する合成関数 andOther(RouterFunction)default RouterFunction<?> andOther(RouterFunction<?> other)
other 関数を呼び出す合成ルーティング関数を返します。other - この関数に結果がない場合に適用する関数 other 関数を使用する合成関数 and(RouterFunction)default RouterFunction<T> andRoute(RequestPredicate predicate, HandlerFunction<T> handlerFunction)
and(RouterFunction) と RouterFunctions.route(RequestPredicate, HandlerFunction) の便利な組み合わせです。predicate - このルートが一致しないかどうかをテストする述語 handlerFunction - このルートが一致せず、述語が適用される場合にルーティングするハンドラー関数 predicate が適用される場合に handlerFunction にルーティングする合成関数 default RouterFunction<T> andNest(RequestPredicate predicate, RouterFunction<T> routerFunction)
and(RouterFunction) と RouterFunctions.nest(RequestPredicate, RouterFunction) の便利な組み合わせです。predicate - このルートが一致しないかどうかをテストする述語 routerFunction - このルートが一致せず、述語が適用される場合にルーティングするルーター関数 predicate が適用される場合に routerFunction にルーティングする合成関数 default <S extends ServerResponse> RouterFunction<S> filter(HandlerFilterFunction<T,S> filterFunction)
S - フィルターの戻り値の型 filterFunction - 適用するフィルター default void accept(RouterFunctions.Visitor visitor)
RouterFunctions.Visitor.unknown(RouterFunction) を呼び出します。構成された RouterFunction 実装は、このルーター関数を構成するすべてのコンポーネントに対して accept を呼び出すことが期待されています。visitor - 受け入れる訪問者 default RouterFunction<T> withAttribute(StringSE name, ObjectSE value)
name - 属性名 value - 属性値 default RouterFunction<T> withAttributes(ConsumerSE<MapSE<StringSE,ObjectSE>> attributesConsumer)
コンシューマーに提供されるマップは「ライブ」であるため、コンシューマーを使用して、既存の属性を上書きしSEたり、属性を削除しSEたり、その他の MapSE メソッドを使用したりできます。
attributesConsumer - 属性マップを使用する関数