Package org.springframework.security.web.util.matcher

# Class ParameterRequestMatcher

java.lang.Object
org.springframework.security.web.util.matcher.ParameterRequestMatcher

All Implemented Interfaces:
  `RequestMatcher`

public final class ParameterRequestMatcher extends Object implements RequestMatcher
A `RequestMatcher` for matching on a request parameter and its value.

The value may also be specified as a placeholder in order to match on any value, returning the value as part of the `RequestMatcher.MatchResult`.

Since:
  6.4

## Nested Class Summary

## Nested classes/interfaces inherited from interface org.springframework.security.web.util.matcher.RequestMatcher

`RequestMatcher.MatchResult`

## Constructor Summary

Constructors
Constructor
Description
`ParameterRequestMatcher(String name)`
`ParameterRequestMatcher(String name, String value)`

## Method Summary

Modifier and Type
Method
Description
`RequestMatcher.MatchResult`
`matcher(jakarta.servlet.http.HttpServletRequest request)`
Returns a MatchResult for this RequestMatcher The default implementation returns `Collections.emptyMap()` when `RequestMatcher.MatchResult.getVariables()` is invoked.
`boolean`
`matches(jakarta.servlet.http.HttpServletRequest request)`
Decides whether the rule implemented by the strategy matches the supplied request.

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

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

## Constructor Details

### ParameterRequestMatcher

public ParameterRequestMatcher(String name)

### ParameterRequestMatcher

public ParameterRequestMatcher(String name, String value)

## Method Details

### matches

public boolean matches(jakarta.servlet.http.HttpServletRequest request)
Description copied from interface: `RequestMatcher`
Decides whether the rule implemented by the strategy matches the supplied request.

Specified by:
  `matches` in interface `RequestMatcher`
Parameters:
  `request` - the request to check for a match
Returns:
  true if the request matches, false otherwise

### matcher

public RequestMatcher.MatchResult matcher(jakarta.servlet.http.HttpServletRequest request)
Description copied from interface: `RequestMatcher`
Returns a MatchResult for this RequestMatcher The default implementation returns `Collections.emptyMap()` when `RequestMatcher.MatchResult.getVariables()` is invoked.

Specified by:
  `matcher` in interface `RequestMatcher`
Returns:
  the MatchResult from comparing this RequestMatcher against the HttpServletRequest