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

# Class NegatedRequestMatcher

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

All Implemented Interfaces:
  `RequestMatcher`

public class NegatedRequestMatcher extends Object implements RequestMatcher
A `RequestMatcher` that will negate the `RequestMatcher` passed in. For example, if the `RequestMatcher` passed in returns true, `NegatedRequestMatcher` will return false. If the `RequestMatcher` passed in returns false, `NegatedRequestMatcher` will return true.

Since:
  3.2

## Nested Class Summary

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

`RequestMatcher.MatchResult`

## Constructor Summary

Constructors
Constructor
Description
`NegatedRequestMatcher(RequestMatcher requestMatcher)`
Creates a new instance

## Method Summary

Modifier and Type
Method
Description
`boolean`
`matches(jakarta.servlet.http.HttpServletRequest request)`
Decides whether the rule implemented by the strategy matches the supplied request.
`String`
`toString()`

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

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

### Methods inherited from interface org.springframework.security.web.util.matcher.RequestMatcher

`matcher`

## Constructor Details

### NegatedRequestMatcher

public NegatedRequestMatcher(RequestMatcher requestMatcher)
Creates a new instance

Parameters:
  `requestMatcher` - the `RequestMatcher` that will be negated.

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

### toString

public String toString()

Overrides:
  `toString` in class `Object`