org.springframework.web.server.handler

## Class DefaultWebFilterChain

- java.lang.Object
- - org.springframework.web.server.handler.DefaultWebFilterChain

- All Implemented Interfaces:
    WebFilterChain

      public class DefaultWebFilterChain
      extends Object
      implements WebFilterChain

  Default implementation of `WebFilterChain`.

  Each instance of this class represents one link in the chain. The public constructor `DefaultWebFilterChain(WebHandler, List)` initializes the full chain and represents its first link.

  This class is immutable and thread-safe. It can be created once and re-used to handle request concurrently.

  Since:
    5.0
  Author:
    Rossen Stoyanchev

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `DefaultWebFilterChain(WebHandler handler, List<WebFilter> filters)` Public constructor with the list of filters and the target handler to use.
    `DefaultWebFilterChain(WebHandler handler, WebFilter... filters)` Deprecated. as of 5.1 this constructor is deprecated in favor of `DefaultWebFilterChain(WebHandler, List)`.

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `reactor.core.publisher.Mono<Void>` | `filter(ServerWebExchange exchange)` Delegate to the next `WebFilter` in the chain.
    `List<WebFilter>` | `getFilters()`
    `WebHandler` | `getHandler()`

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

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

- - ### Constructor Detail

    - #### DefaultWebFilterChain

          public DefaultWebFilterChain(WebHandler handler,
                                       List<WebFilter> filters)

      Public constructor with the list of filters and the target handler to use.
      Parameters:
        `handler` - the target handler
        `filters` - the filters ahead of the handler
      Since:
        5.1

    - #### DefaultWebFilterChain

          @Deprecated
          public DefaultWebFilterChain(WebHandler handler,
                                                   WebFilter... filters)

      Deprecated. as of 5.1 this constructor is deprecated in favor of `DefaultWebFilterChain(WebHandler, List)`.
      Public constructor with the list of filters and the target handler to use.
      Parameters:
        `handler` - the target handler
        `filters` - the filters ahead of the handler

  - ### Method Detail

    - #### getFilters

          public List<WebFilter> getFilters()

    - #### getHandler

          public WebHandler getHandler()

    - #### filter

          public reactor.core.publisher.Mono<Void> filter(ServerWebExchange exchange)

      Description copied from interface: `WebFilterChain`
      Delegate to the next `WebFilter` in the chain.
      Specified by:
        `filter` in interface `WebFilterChain`
      Parameters:
        `exchange` - the current server exchange
      Returns:
        `Mono<Void>` to indicate when request handling is complete