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

# Class RequestMatchers

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

public final class RequestMatchers extends Object
A factory class to create `RequestMatcher` instances.

Since:
  6.1

## Method Summary

Modifier and Type
Method
Description
`static RequestMatcher`
`allOf(RequestMatcher... matchers)`
Creates a `RequestMatcher` that matches if all the given `RequestMatcher`s match, if `matchers` are empty then the returned matcher always matches.
`static RequestMatcher`
`anyOf(RequestMatcher... matchers)`
Creates a `RequestMatcher` that matches if at least one of the given `RequestMatcher`s matches, if `matchers` are empty then the returned matcher never matches.
`static RequestMatcher`
`not(RequestMatcher matcher)`
Creates a `RequestMatcher` that matches if the given `RequestMatcher` does not match.

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

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

## Method Details

### anyOf

public static RequestMatcher anyOf(RequestMatcher... matchers)
Creates a `RequestMatcher` that matches if at least one of the given `RequestMatcher`s matches, if `matchers` are empty then the returned matcher never matches.

Parameters:
  `matchers` - the `RequestMatcher`s to use
Returns:
  the any-of composed `RequestMatcher`
See Also:
  - `OrRequestMatcher`

### allOf

public static RequestMatcher allOf(RequestMatcher... matchers)
Creates a `RequestMatcher` that matches if all the given `RequestMatcher`s match, if `matchers` are empty then the returned matcher always matches.

Parameters:
  `matchers` - the `RequestMatcher`s to use
Returns:
  the all-of composed `RequestMatcher`
See Also:
  - `AndRequestMatcher`

### not

public static RequestMatcher not(RequestMatcher matcher)
Creates a `RequestMatcher` that matches if the given `RequestMatcher` does not match.

Parameters:
  `matcher` - the `RequestMatcher` to use
Returns:
  the inverted `RequestMatcher`