spring-framework / org.springframework.web.reactive.result.method / RequestMappingInfo

RequestMappingInfo

class RequestMappingInfo : RequestCondition<RequestMappingInfo>

Encapsulates the following request mapping conditions:

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

Author
Rossen Stoyanchev

Since
5.0

Constructors

<init>

RequestMappingInfo(name: String, patterns: PatternsRequestCondition, methods: RequestMethodsRequestCondition, params: ParamsRequestCondition, headers: HeadersRequestCondition, consumes: ConsumesRequestCondition, produces: ProducesRequestCondition, custom: RequestCondition<*>)RequestMappingInfo(patterns: PatternsRequestCondition, methods: RequestMethodsRequestCondition, params: ParamsRequestCondition, headers: HeadersRequestCondition, consumes: ConsumesRequestCondition, produces: ProducesRequestCondition, custom: RequestCondition<*>)

Creates a new instance with the given request conditions.

RequestMappingInfo(info: RequestMappingInfo, customRequestCondition: RequestCondition<*>)

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

Functions

combine

fun combine(other: RequestMappingInfo): RequestMappingInfo

Combines "this" request mapping info (i.e. the current instance) with another request mapping info instance.

Example: combine type- and method-level request mappings.

compareTo

fun compareTo(other: RequestMappingInfo, exchange: ServerWebExchange): Int

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.

equals

fun equals(other: Any?): Boolean

getConsumesCondition

fun getConsumesCondition(): ConsumesRequestCondition

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

getCustomCondition

fun getCustomCondition(): RequestCondition<*>

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

getHeadersCondition

fun getHeadersCondition(): HeadersRequestCondition

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

getMatchingCondition

fun getMatchingCondition(exchange: ServerWebExchange): RequestMappingInfo

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.

getMethodsCondition

fun getMethodsCondition(): RequestMethodsRequestCondition

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

getName

fun getName(): String

Return the name for this mapping, or null.

getParamsCondition

fun getParamsCondition(): ParamsRequestCondition

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

getPatternsCondition

fun getPatternsCondition(): PatternsRequestCondition

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

getProducesCondition

fun getProducesCondition(): ProducesRequestCondition

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

hashCode

fun hashCode(): Int

paths

static fun paths(vararg paths: String): Builder

Create a new RequestMappingInfo.Builder with the given paths.

toString

fun toString(): String