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 SummaryNested ClassesModifier and TypeClassDescriptionstatic interfaceDefines a builder for creating a RequestMappingInfo.static classContainer for configuration options used for request mapping purposes.
- 
Constructor SummaryConstructorsConstructorDescriptionRequestMappingInfo(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 SummaryModifier 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- 
getNameReturn the name for this mapping, ornull.
- 
getPatternsConditionReturns the URL patterns of thisRequestMappingInfo; or instance with 0 patterns, nevernull.
- 
getDirectPathsReturn the mapping paths that are not patterns.- Since:
- 5.3
 
- 
getMethodsConditionReturns the HTTP request methods of thisRequestMappingInfo; or instance with 0 request methods, nevernull.
- 
getParamsConditionReturns the "parameters" condition of thisRequestMappingInfo; or instance with 0 parameter expressions, nevernull.
- 
getHeadersConditionReturns the "headers" condition of thisRequestMappingInfo; or instance with 0 header expressions, nevernull.
- 
getConsumesConditionReturns the "consumes" condition of thisRequestMappingInfo; or instance with 0 consumes expressions, nevernull.
- 
getProducesConditionReturns the "produces" condition of thisRequestMappingInfo; or instance with 0 produces expressions, nevernull.
- 
getCustomConditionReturns the "custom" condition of thisRequestMappingInfo; ornull.
- 
combineCombines "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 interface- RequestCondition<RequestMappingInfo>
- Parameters:
- other- the condition to combine with.
- Returns:
- a new request mapping info instance; never null
 
- 
getMatchingConditionChecks 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 interface- RequestCondition<RequestMappingInfo>
- Returns:
- a new instance in case all conditions match; or nullotherwise
 
- 
compareToCompares "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 interface- RequestCondition<RequestMappingInfo>
 
- 
equals
- 
hashCodepublic int hashCode()
- 
toString
- 
mutateReturn a builder to create a new RequestMappingInfo by modifying this one.- Returns:
- a builder to create a new, modified instance
- Since:
- 5.3.4
 
- 
pathsCreate a newRequestMappingInfo.Builderwith the given paths.- Parameters:
- paths- the paths to use
 
 
- 
RequestMappingInfo.Builderviapaths(String...).