org.springframework.web.reactive.result.method

## 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:

1. `PatternsRequestCondition`
2. `RequestMethodsRequestCondition`
3. `ParamsRequestCondition`
4. `HeadersRequestCondition`
5. `ConsumesRequestCondition`
6. `ProducesRequestCondition`
7. `RequestCondition` (optional, custom request condition)

Since:
  5.0
Author:
  Rossen Stoyanchev

### Nested Class Summary

Nested Classes
`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 Summary

Constructors
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)`

### Method Summary

All Methods Static Methods Instance Methods Concrete Methods
`RequestMappingInfo` `combine(RequestMappingInfo other)` Combines "this" request mapping info (i.e.
`int` `compareTo(RequestMappingInfo other, org.springframework.web.server.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`.
`HeadersRequestCondition` `getHeadersCondition()` Returns the "headers" condition of this `RequestMappingInfo`; or instance with 0 header expressions, never `null`.
`RequestMappingInfo` `getMatchingCondition(org.springframework.web.server.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()`

### Methods inherited from class java.lang.Object

`clone, finalize, getClass, notify, notifyAll, wait, wait, wait`

### Constructor Detail

#### RequestMappingInfo

    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)

#### RequestMappingInfo

    public RequestMappingInfo(@Nullable
                              PatternsRequestCondition patterns,
                              @Nullable
                              RequestMethodsRequestCondition methods,
                              @Nullable
                              ParamsRequestCondition params,
                              @Nullable
                              HeadersRequestCondition headers,
                              @Nullable
                              ConsumesRequestCondition consumes,
                              @Nullable
                              ProducesRequestCondition produces,
                              @Nullable
                              RequestCondition<?> custom)

Creates a new instance with the given request conditions.

#### RequestMappingInfo

    public RequestMappingInfo(RequestMappingInfo info,
                              @Nullable
                              RequestCondition<?> customRequestCondition)

Re-create a RequestMappingInfo with the given custom request condition.

### Method Detail

#### getName

    @Nullable
    public String getName()

Return the name for this mapping, or `null`.

#### getPatternsCondition

    public PatternsRequestCondition getPatternsCondition()

Returns the URL patterns of this `RequestMappingInfo`; or instance with 0 patterns, never `null`.

#### getMethodsCondition

    public RequestMethodsRequestCondition getMethodsCondition()

Returns the HTTP request methods of this `RequestMappingInfo`; or instance with 0 request methods, never `null`.

#### getParamsCondition

    public ParamsRequestCondition getParamsCondition()

Returns the "parameters" condition of this `RequestMappingInfo`; or instance with 0 parameter expressions, never `null`.

#### getHeadersCondition

    public HeadersRequestCondition getHeadersCondition()

Returns the "headers" condition of this `RequestMappingInfo`; or instance with 0 header expressions, never `null`.

#### getConsumesCondition

    public ConsumesRequestCondition getConsumesCondition()

Returns the "consumes" condition of this `RequestMappingInfo`; or instance with 0 consumes expressions, never `null`.

#### getProducesCondition

    public ProducesRequestCondition getProducesCondition()

Returns the "produces" condition of this `RequestMappingInfo`; or instance with 0 produces expressions, never `null`.

#### getCustomCondition

    @Nullable
    public RequestCondition<?> getCustomCondition()

Returns the "custom" condition of this `RequestMappingInfo`; or `null`.

#### combine

    public RequestMappingInfo combine(RequestMappingInfo other)

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 interface `RequestCondition<RequestMappingInfo>`
Parameters:
  `other` - the condition to combine with.
Returns:
  a new request mapping info instance; never `null`

#### getMatchingCondition

    @Nullable
    public RequestMappingInfo getMatchingCondition(org.springframework.web.server.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.

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 interface `RequestCondition<RequestMappingInfo>`
Returns:
  a new instance in case all conditions match; or `null` otherwise

#### compareTo

    public int compareTo(RequestMappingInfo other,
                         org.springframework.web.server.ServerWebExchange exchange)

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 interface `RequestCondition<RequestMappingInfo>`

#### equals

    public boolean equals(@Nullable
                          Object other)

Overrides:
  `equals` in class `Object`

#### hashCode

    public int hashCode()

Overrides:
  `hashCode` in class `Object`

#### toString

    public String toString()

Overrides:
  `toString` in class `Object`

#### paths

    public static RequestMappingInfo.Builder paths(String... paths)

Create a new `RequestMappingInfo.Builder` with the given paths.

Parameters:
  `paths` - the paths to use