Class RequestMappingInfo
java.lang.Object
org.springframework.web.reactive.result.method.RequestMappingInfo
- All Implemented Interfaces:
RequestCondition<RequestMappingInfo>
public final class RequestMappingInfo
extends Object
implements RequestCondition<RequestMappingInfo>
Request mapping information. Encapsulates the following request mapping conditions:
PatternsRequestCondition
RequestMethodsRequestCondition
ParamsRequestCondition
HeadersRequestCondition
ConsumesRequestCondition
ProducesRequestCondition
RequestCondition
(optional, custom request condition)
- Since:
- 5.0
- Author:
- Rossen Stoyanchev
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic interface
Defines a builder for creating a RequestMappingInfo.static class
Container for configuration options used for request mapping purposes. -
Constructor Summary
ConstructorDescriptionRequestMappingInfo
(String name, PatternsRequestCondition patterns, RequestMethodsRequestCondition methods, ParamsRequestCondition params, HeadersRequestCondition headers, ConsumesRequestCondition consumes, ProducesRequestCondition produces, RequestCondition<?> custom) Deprecated.RequestMappingInfo
(PatternsRequestCondition patterns, RequestMethodsRequestCondition methods, ParamsRequestCondition params, HeadersRequestCondition headers, ConsumesRequestCondition consumes, ProducesRequestCondition produces, RequestCondition<?> custom) Deprecated.as of 5.3.4 in favor usingRequestMappingInfo.Builder
viapaths(String...)
.RequestMappingInfo
(RequestMappingInfo info, RequestCondition<?> customRequestCondition) Deprecated.since 5.3.4 in favor of using aRequestMappingInfo.Builder
viamutate()
. -
Method Summary
Modifier and TypeMethodDescriptioncombine
(RequestMappingInfo other) Combines "this" request mapping info (i.e.int
compareTo
(RequestMappingInfo other, ServerWebExchange exchange) Compares "this" info (i.e.boolean
Returns the "consumes" condition of thisRequestMappingInfo
; or instance with 0 consumes expressions, nevernull
.Returns the "custom" condition of thisRequestMappingInfo
; ornull
.Return the mapping paths that are not patterns.Returns the "headers" condition of thisRequestMappingInfo
; or instance with 0 header expressions, nevernull
.getMatchingCondition
(ServerWebExchange exchange) Checks if all conditions in this request mapping info match the provided request and returns a potentially new request mapping info with conditions tailored to the current request.Returns the HTTP request methods of thisRequestMappingInfo
; or instance with 0 request methods, nevernull
.getName()
Return the name for this mapping, ornull
.Returns the "parameters" condition of thisRequestMappingInfo
; or instance with 0 parameter expressions, nevernull
.Returns the URL patterns of thisRequestMappingInfo
; or instance with 0 patterns, nevernull
.Returns the "produces" condition of thisRequestMappingInfo
; or instance with 0 produces expressions, nevernull
.int
hashCode()
mutate()
Return a builder to create a new RequestMappingInfo by modifying this one.static RequestMappingInfo.Builder
Create a newRequestMappingInfo.Builder
with the given paths.toString()
-
Constructor Details
-
RequestMappingInfo
@Deprecated public RequestMappingInfo(@Nullable String name, @Nullable PatternsRequestCondition patterns, @Nullable RequestMethodsRequestCondition methods, @Nullable ParamsRequestCondition params, @Nullable HeadersRequestCondition headers, @Nullable ConsumesRequestCondition consumes, @Nullable ProducesRequestCondition produces, @Nullable RequestCondition<?> custom) Deprecated.as of 5.3.4 in favor usingRequestMappingInfo.Builder
viapaths(String...)
.Full constructor with a mapping name. -
RequestMappingInfo
@Deprecated public RequestMappingInfo(@Nullable PatternsRequestCondition patterns, @Nullable RequestMethodsRequestCondition methods, @Nullable ParamsRequestCondition params, @Nullable HeadersRequestCondition headers, @Nullable ConsumesRequestCondition consumes, @Nullable ProducesRequestCondition produces, @Nullable RequestCondition<?> custom) Deprecated.as of 5.3.4 in favor usingRequestMappingInfo.Builder
viapaths(String...)
.Create an instance with the given conditions. -
RequestMappingInfo
@Deprecated public RequestMappingInfo(RequestMappingInfo info, @Nullable RequestCondition<?> customRequestCondition) Deprecated.since 5.3.4 in favor of using aRequestMappingInfo.Builder
viamutate()
.Re-create a RequestMappingInfo with the given custom request condition.
-
-
Method Details
-
getName
Return the name for this mapping, ornull
. -
getPatternsCondition
Returns the URL patterns of thisRequestMappingInfo
; or instance with 0 patterns, nevernull
. -
getDirectPaths
Return the mapping paths that are not patterns.- Since:
- 5.3
-
getMethodsCondition
Returns the HTTP request methods of thisRequestMappingInfo
; or instance with 0 request methods, nevernull
. -
getParamsCondition
Returns the "parameters" condition of thisRequestMappingInfo
; or instance with 0 parameter expressions, nevernull
. -
getHeadersCondition
Returns the "headers" condition of thisRequestMappingInfo
; or instance with 0 header expressions, nevernull
. -
getConsumesCondition
Returns the "consumes" condition of thisRequestMappingInfo
; or instance with 0 consumes expressions, nevernull
. -
getProducesCondition
Returns the "produces" condition of thisRequestMappingInfo
; or instance with 0 produces expressions, nevernull
. -
getCustomCondition
Returns the "custom" condition of thisRequestMappingInfo
; ornull
. -
combine
Combines "this" request mapping info (i.e. the current instance) with another request mapping info instance.Example: combine type- and method-level request mappings.
- Specified by:
combine
in interfaceRequestCondition<RequestMappingInfo>
- Parameters:
other
- the condition to combine with.- Returns:
- a new request mapping info instance; never
null
-
getMatchingCondition
Checks if all conditions in this request mapping info match the provided request and returns a potentially new request mapping info with conditions tailored to the current request.For example the returned instance may contain the subset of URL patterns that match to the current request, sorted with best matching patterns on top.
- Specified by:
getMatchingCondition
in interfaceRequestCondition<RequestMappingInfo>
- Returns:
- a new instance in case all conditions match; or
null
otherwise
-
compareTo
Compares "this" info (i.e. the current instance) with another info in the context of a request.Note: It is assumed both instances have been obtained via
getMatchingCondition(ServerWebExchange)
to ensure they have conditions with content relevant to current request.- Specified by:
compareTo
in interfaceRequestCondition<RequestMappingInfo>
-
equals
-
hashCode
public int hashCode() -
toString
-
mutate
Return a builder to create a new RequestMappingInfo by modifying this one.- Returns:
- a builder to create a new, modified instance
- Since:
- 5.3.4
-
paths
Create a newRequestMappingInfo.Builder
with the given paths.- Parameters:
paths
- the paths to use
-
RequestMappingInfo.Builder
viapaths(String...)
.