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:
PatternsRequestConditionRequestMethodsRequestConditionParamsRequestConditionHeadersRequestConditionConsumesRequestConditionProducesRequestConditionRequestCondition(optional, custom request condition)
- Since:
- 5.0
- Author:
- Rossen Stoyanchev
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic interfaceDefines a builder for creating a RequestMappingInfo.static classContainer for configuration options used for request mapping purposes. -
Constructor Summary
ConstructorsConstructorDescriptionRequestMappingInfo(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.Builderviapaths(String...).RequestMappingInfo(RequestMappingInfo info, RequestCondition<?> customRequestCondition) Deprecated.since 5.3.4 in favor of using aRequestMappingInfo.Builderviamutate(). -
Method Summary
Modifier and TypeMethodDescriptioncombine(RequestMappingInfo other) Combines "this" request mapping info (i.e.intcompareTo(RequestMappingInfo other, ServerWebExchange exchange) Compares "this" info (i.e.booleanReturns 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.inthashCode()mutate()Return a builder to create a new RequestMappingInfo by modifying this one.static RequestMappingInfo.BuilderCreate a newRequestMappingInfo.Builderwith 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.Builderviapaths(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.Builderviapaths(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.Builderviamutate().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:
combinein 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:
getMatchingConditionin interfaceRequestCondition<RequestMappingInfo>- Returns:
- a new instance in case all conditions match; or
nullotherwise
-
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:
compareToin 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.Builderwith the given paths.- Parameters:
paths- the paths to use
-
RequestMappingInfo.Builderviapaths(String...).