io.undertow.predicate

## Class PredicatesHandler

- java.lang.Object
- - io.undertow.predicate.PredicatesHandler

All Implemented Interfaces:
  HttpHandler

    public class PredicatesHandler
    extends Object
    implements HttpHandler

Handler that can deal with a large number of predicates. chaining together a large number of `PredicatesHandler.Holder` instances will make the stack grow to large, so this class is used that can deal with a large number of predicates.

Author:
  Stuart Douglas

### Nested Class Summary

Nested Classes
`static class` `PredicatesHandler.DoneHandlerBuilder`
`static class` `PredicatesHandler.RestartHandlerBuilder`
`static class` `PredicatesHandler.Wrapper`

### Field Summary

Fields
`static AttachmentKey<Boolean>` `DONE` static done marker.
`static AttachmentKey<Boolean>` `RESTART`

### Constructor Summary

Constructors
Constructor and Description
`PredicatesHandler(HttpHandler next)`
`PredicatesHandler(HttpHandler next, boolean outerHandler)`

### Method Summary

All Methods Instance Methods Concrete Methods
`PredicatesHandler` `addPredicatedHandler(PredicatedHandler handler)`
`PredicatesHandler` `addPredicatedHandler(Predicate predicate, HandlerWrapper handlerWrapper)` Adds a new predicated handler.
`PredicatesHandler` `addPredicatedHandler(Predicate predicate, HandlerWrapper handlerWrapper, HandlerWrapper elseBranch)` Adds a new predicated handler.
`HttpHandler` `getNext()`
`void` `handleRequest(HttpServerExchange exchange)` Handle the request.
`void` `setNext(HttpHandler next)`
`String` `toString()`

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

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

### Field Detail

#### DONE

    public static final AttachmentKey<Boolean> DONE

static done marker. If this is attached to the exchange it will drop out immediately.

#### RESTART

    public static final AttachmentKey<Boolean> RESTART

### Constructor Detail

#### PredicatesHandler

    public PredicatesHandler(HttpHandler next)

#### PredicatesHandler

    public PredicatesHandler(HttpHandler next,
                             boolean outerHandler)

### Method Detail

#### toString

    public String toString()

Overrides:
  `toString` in class `Object`

#### handleRequest

    public void handleRequest(HttpServerExchange exchange)
                       throws Exception

Description copied from interface: `HttpHandler`
Handle the request.

Specified by:
  `handleRequest` in interface `HttpHandler`
Parameters:
  `exchange` - the HTTP request/response exchange
Throws:
  `Exception`

#### addPredicatedHandler

    public PredicatesHandler addPredicatedHandler(Predicate predicate,
                                                  HandlerWrapper handlerWrapper,
                                                  HandlerWrapper elseBranch)

Adds a new predicated handler.

Parameters:
  `predicate` -
  `handlerWrapper` -

#### addPredicatedHandler

    public PredicatesHandler addPredicatedHandler(Predicate predicate,
                                                  HandlerWrapper handlerWrapper)

Adds a new predicated handler.

Parameters:
  `predicate` -
  `handlerWrapper` -

#### addPredicatedHandler

    public PredicatesHandler addPredicatedHandler(PredicatedHandler handler)

#### setNext

    public void setNext(HttpHandler next)

#### getNext

    public HttpHandler getNext()