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

# Class MvcRequestMatcher.Builder

java.lang.Object
org.springframework.security.web.servlet.util.matcher.MvcRequestMatcher.Builder

Enclosing class:
  MvcRequestMatcher

public static final class MvcRequestMatcher.Builder extends Object
A builder for `MvcRequestMatcher`

Since:
  5.8

## Constructor Summary

Constructors
Constructor
Description
`Builder(org.springframework.web.servlet.handler.HandlerMappingIntrospector introspector)`
Construct a new instance of this builder

## Method Summary

Modifier and Type
Method
Description
`MvcRequestMatcher`
`pattern(String pattern)`
Creates an `MvcRequestMatcher` that uses the provided pattern to match
`MvcRequestMatcher`
`pattern(org.springframework.http.HttpMethod method, String pattern)`
Creates an `MvcRequestMatcher` that uses the provided pattern and HTTP method to match
`MvcRequestMatcher.Builder`
`servletPath(String servletPath)`
Sets the servlet path to be used by the `MvcRequestMatcher` generated by this builder

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

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

## Constructor Details

### Builder

public Builder(org.springframework.web.servlet.handler.HandlerMappingIntrospector introspector)
Construct a new instance of this builder

## Method Details

### servletPath

public MvcRequestMatcher.Builder servletPath(String servletPath)
Sets the servlet path to be used by the `MvcRequestMatcher` generated by this builder

Parameters:
  `servletPath` - the servlet path to use
Returns:
  the `MvcRequestMatcher.Builder` for further configuration

### pattern

public MvcRequestMatcher pattern(String pattern)
Creates an `MvcRequestMatcher` that uses the provided pattern to match

Parameters:
  `pattern` - the pattern used to match
Returns:
  the generated `MvcRequestMatcher`

### pattern

public MvcRequestMatcher pattern(org.springframework.http.HttpMethod method, String pattern)
Creates an `MvcRequestMatcher` that uses the provided pattern and HTTP method to match

Parameters:
  `method` - the `HttpMethod`, can be null
  `pattern` - the patterns used to match
Returns:
  the generated `MvcRequestMatcher`