Top Description Inners Fields Constructors Methods
org.springframework.web.reactive.result.condition

public final Class ParamsRequestCondition

extends AbstractRequestCondition<ParamsRequestCondition>
Class Inheritance
Imports
java.util.Collection, .Collections, .LinkedHashSet, .Set, org.springframework.lang.Nullable, org.springframework.util.ObjectUtils, org.springframework.web.bind.annotation.RequestMapping, org.springframework.web.server.ServerWebExchange

A logical conjunction (' && ') request condition that matches a request against a set parameter expressions with syntax defined in RequestMapping#params().
Author
Rossen Stoyanchev
Since
5.0

Nested and Inner Type Summary

Modifier and TypeClass and Description
pack-priv static class
ParamsRequestCondition.ParamExpression

Parses and matches a single param expression to a request.

Field Summary

Modifier and TypeField and Description
private final Set<ParamsRequestCondition.ParamExpression>

Constructor Summary

AccessConstructor and Description
public
ParamsRequestCondition(String...
expressions with syntax defined in RequestMapping#params(); if 0, the condition will match to every request.
params
)

Create a new instance from the given param expressions.

private

Method Summary

Modifier and TypeMethod and Description
public ParamsRequestCondition
combine(ParamsRequestCondition
the condition to combine with.
other
)

Implements org.springframework.web.reactive.result.condition.RequestCondition.combine.

Returns a new instance with the union of the param expressions from "this" and the "other" instance.

public int
compareTo(ParamsRequestCondition other, ServerWebExchange exchange)

Implements org.springframework.web.reactive.result.condition.RequestCondition.compareTo.

Compare to another condition based on parameter expressions.

protected Collection<ParamsRequestCondition.ParamExpression>
getContent()

Implements abstract org.springframework.web.reactive.result.condition.AbstractRequestCondition.getContent.

Return the discrete items a request condition is composed of.

public Set<NameValueExpression<String>>
getExpressions()

Return the contained request parameter expressions.

public ParamsRequestCondition
getMatchingCondition(ServerWebExchange exchange)

Implements org.springframework.web.reactive.result.condition.RequestCondition.getMatchingCondition.

Returns "this" instance if the request matches all param expressions; or null otherwise.

protected String
getToStringInfix()

Implements abstract org.springframework.web.reactive.result.condition.AbstractRequestCondition.getToStringInfix.

The notation to use when printing discrete items of content.

private long
private static Set<ParamsRequestCondition.ParamExpression>
Inherited from org.springframework.web.reactive.result.condition.AbstractRequestCondition:
equalshashCodeisEmptytoString

Field Detail

expressionsback to summary
private final Set<ParamsRequestCondition.ParamExpression> expressions

Constructor Detail

ParamsRequestConditionback to summary
public ParamsRequestCondition(String... params)

Create a new instance from the given param expressions.

Parameters
params:String[]

expressions with syntax defined in RequestMapping#params(); if 0, the condition will match to every request.

ParamsRequestConditionback to summary
private ParamsRequestCondition(Set<ParamsRequestCondition.ParamExpression> conditions)

Method Detail

combineback to summary
public ParamsRequestCondition combine(ParamsRequestCondition other)

Implements org.springframework.web.reactive.result.condition.RequestCondition.combine.

Returns a new instance with the union of the param expressions from "this" and the "other" instance.

Parameters
other:ParamsRequestCondition

Doc from org.springframework.web.reactive.result.condition.RequestCondition.combine.

the condition to combine with.

Returns:ParamsRequestCondition

Doc from org.springframework.web.reactive.result.condition.RequestCondition.combine.

a request condition instance that is the result of combining the two condition instances.

Annotations
@Override
compareToback to summary
public int compareTo(ParamsRequestCondition other, ServerWebExchange exchange)

Implements org.springframework.web.reactive.result.condition.RequestCondition.compareTo.

Compare to another condition based on parameter expressions. A condition is considered to be a more specific match, if it has:

  1. A greater number of expressions.
  2. A greater number of non-negated expressions with a concrete value.

It is assumed that both instances have been obtained via getMatchingCondition(ServerWebExchange) and each instance contains the matching parameter expressions only or is otherwise empty.

Annotations
@Override
getContentback to summary
protected Collection<ParamsRequestCondition.ParamExpression> getContent()

Implements abstract org.springframework.web.reactive.result.condition.AbstractRequestCondition.getContent.

Doc from org.springframework.web.reactive.result.condition.AbstractRequestCondition.getContent.

Return the discrete items a request condition is composed of.

For example URL patterns, HTTP request methods, param expressions, etc.

Returns:Collection<ParamsRequestCondition.ParamExpression>

a collection of objects (never null)

Annotations
@Override
getExpressionsback to summary
public Set<NameValueExpression<String>> getExpressions()

Return the contained request parameter expressions.

getMatchingConditionback to summary
public ParamsRequestCondition getMatchingCondition(ServerWebExchange exchange)

Implements org.springframework.web.reactive.result.condition.RequestCondition.getMatchingCondition.

Returns "this" instance if the request matches all param expressions; or null otherwise.

Returns:ParamsRequestCondition

Doc from org.springframework.web.reactive.result.condition.RequestCondition.getMatchingCondition.

a condition instance in case of a match or null otherwise.

Annotations
@Override
@Nullable
getToStringInfixback to summary
protected String getToStringInfix()

Implements abstract org.springframework.web.reactive.result.condition.AbstractRequestCondition.getToStringInfix.

Doc from org.springframework.web.reactive.result.condition.AbstractRequestCondition.getToStringInfix.

The notation to use when printing discrete items of content.

For example " || " for URL patterns or " && " for param expressions.

Annotations
@Override
getValueMatchCountback to summary
private long getValueMatchCount(Set<ParamsRequestCondition.ParamExpression> expressions)
parseExpressionsback to summary
private static Set<ParamsRequestCondition.ParamExpression> parseExpressions(String... params)
org.springframework.web.reactive.result.condition back to summary

pack-priv Class ParamsRequestCondition.ParamExpression

extends AbstractNameValueExpression<String>
Class Inheritance

Parses and matches a single param expression to a request.

Field Summary

Inherited from org.springframework.web.reactive.result.condition.AbstractNameValueExpression:
isNegatednamevalue

Constructor Summary

AccessConstructor and Description
pack-priv
ParamExpression(String expression)

Method Summary

Modifier and TypeMethod and Description
protected boolean
protected boolean
protected boolean
protected String
Inherited from org.springframework.web.reactive.result.condition.AbstractNameValueExpression:
equalsgetNamegetValuehashCodeisNegatedmatchtoString

Constructor Detail

ParamExpressionback to summary
pack-priv ParamExpression(String expression)

Method Detail

isCaseSensitiveNameback to summary
protected boolean isCaseSensitiveName()

Implements abstract org.springframework.web.reactive.result.condition.AbstractNameValueExpression.isCaseSensitiveName.

Annotations
@Override
matchNameback to summary
protected boolean matchName(ServerWebExchange exchange)

Implements abstract org.springframework.web.reactive.result.condition.AbstractNameValueExpression.matchName.

Annotations
@Override
matchValueback to summary
protected boolean matchValue(ServerWebExchange exchange)

Implements abstract org.springframework.web.reactive.result.condition.AbstractNameValueExpression.matchValue.

Annotations
@Override
parseValueback to summary
protected String parseValue(String valueExpression)

Implements abstract org.springframework.web.reactive.result.condition.AbstractNameValueExpression.parseValue.

Annotations
@Override