public final class RequestMappingInfo extends Object implements RequestCondition<RequestMappingInfo>
PatternsRequestCondition
RequestMethodsRequestCondition
ParamsRequestCondition
HeadersRequestCondition
ConsumesRequestCondition
ProducesRequestCondition
RequestCondition
(optional, custom request condition)
Modifier and Type | Class and Description |
---|---|
static interface |
RequestMappingInfo.Builder
Defines a builder for creating a RequestMappingInfo.
|
static class |
RequestMappingInfo.BuilderConfiguration
Container for configuration options used for request mapping purposes.
|
Constructor and Description |
---|
RequestMappingInfo(PatternsRequestCondition patterns,
RequestMethodsRequestCondition methods,
ParamsRequestCondition params,
HeadersRequestCondition headers,
ConsumesRequestCondition consumes,
ProducesRequestCondition produces,
RequestCondition<?> custom)
Creates a new instance with the given request conditions.
|
RequestMappingInfo(RequestMappingInfo info,
RequestCondition<?> customRequestCondition)
Re-create a RequestMappingInfo with the given custom request condition.
|
RequestMappingInfo(String name,
PatternsRequestCondition patterns,
RequestMethodsRequestCondition methods,
ParamsRequestCondition params,
HeadersRequestCondition headers,
ConsumesRequestCondition consumes,
ProducesRequestCondition produces,
RequestCondition<?> custom) |
Modifier and Type | Method and Description |
---|---|
RequestMappingInfo |
combine(RequestMappingInfo other)
Combines "this" request mapping info (i.e.
|
int |
compareTo(RequestMappingInfo other,
ServerWebExchange exchange)
Compares "this" info (i.e.
|
boolean |
equals(Object other) |
ConsumesRequestCondition |
getConsumesCondition()
Returns the "consumes" condition of this
RequestMappingInfo ;
or instance with 0 consumes expressions, never null . |
RequestCondition<?> |
getCustomCondition()
Returns the "custom" condition of this
RequestMappingInfo ; or null . |
Set<String> |
getDirectPaths()
Return the mapping paths that are not patterns.
|
HeadersRequestCondition |
getHeadersCondition()
Returns the "headers" condition of this
RequestMappingInfo ;
or instance with 0 header expressions, never null . |
RequestMappingInfo |
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.
|
RequestMethodsRequestCondition |
getMethodsCondition()
Returns the HTTP request methods of this
RequestMappingInfo ;
or instance with 0 request methods, never null . |
String |
getName()
Return the name for this mapping, or
null . |
ParamsRequestCondition |
getParamsCondition()
Returns the "parameters" condition of this
RequestMappingInfo ;
or instance with 0 parameter expressions, never null . |
PatternsRequestCondition |
getPatternsCondition()
Returns the URL patterns of this
RequestMappingInfo ;
or instance with 0 patterns, never null . |
ProducesRequestCondition |
getProducesCondition()
Returns the "produces" condition of this
RequestMappingInfo ;
or instance with 0 produces expressions, never null . |
int |
hashCode() |
static RequestMappingInfo.Builder |
paths(String... paths)
Create a new
RequestMappingInfo.Builder with the given paths. |
String |
toString() |
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)
public RequestMappingInfo(@Nullable PatternsRequestCondition patterns, @Nullable RequestMethodsRequestCondition methods, @Nullable ParamsRequestCondition params, @Nullable HeadersRequestCondition headers, @Nullable ConsumesRequestCondition consumes, @Nullable ProducesRequestCondition produces, @Nullable RequestCondition<?> custom)
public RequestMappingInfo(RequestMappingInfo info, @Nullable RequestCondition<?> customRequestCondition)
public PatternsRequestCondition getPatternsCondition()
RequestMappingInfo
;
or instance with 0 patterns, never null
.public Set<String> getDirectPaths()
public RequestMethodsRequestCondition getMethodsCondition()
RequestMappingInfo
;
or instance with 0 request methods, never null
.public ParamsRequestCondition getParamsCondition()
RequestMappingInfo
;
or instance with 0 parameter expressions, never null
.public HeadersRequestCondition getHeadersCondition()
RequestMappingInfo
;
or instance with 0 header expressions, never null
.public ConsumesRequestCondition getConsumesCondition()
RequestMappingInfo
;
or instance with 0 consumes expressions, never null
.public ProducesRequestCondition getProducesCondition()
RequestMappingInfo
;
or instance with 0 produces expressions, never null
.@Nullable public RequestCondition<?> getCustomCondition()
RequestMappingInfo
; or null
.public RequestMappingInfo combine(RequestMappingInfo other)
Example: combine type- and method-level request mappings.
combine
in interface RequestCondition<RequestMappingInfo>
other
- the condition to combine with.null
@Nullable public RequestMappingInfo getMatchingCondition(ServerWebExchange exchange)
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.
getMatchingCondition
in interface RequestCondition<RequestMappingInfo>
null
otherwisepublic int compareTo(RequestMappingInfo other, ServerWebExchange exchange)
Note: It is assumed both instances have been obtained via
getMatchingCondition(ServerWebExchange)
to ensure they have conditions with
content relevant to current request.
compareTo
in interface RequestCondition<RequestMappingInfo>
public static RequestMappingInfo.Builder paths(String... paths)
RequestMappingInfo.Builder
with the given paths.paths
- the paths to use