Interface Handler.Collection

All Superinterfaces:
Destroyable, Handler, Handler.Container, Invocable, LifeCycle, Request.Handler
All Known Implementing Classes:
ContextHandlerCollection, Handler.Sequence
Enclosing interface:
Handler

public static interface Handler.Collection extends Handler.Container

A Handler.Container that can contain multiple other Handlers.

See Also:
  • Method Details

    • addHandler

      default void addHandler(Handler handler)

      Adds the given Handler to this collection of Handlers.

      Parameters:
      handler - the Handler to add
    • removeHandler

      default boolean removeHandler(Handler handler)

      Removes the given Handler from this collection of Handlers.

      Parameters:
      handler - the Handler to remove
      Returns:
      whether the Handler was removed
    • addHandler

      default void addHandler(Supplier<Handler> supplier)

      Adds the Handler supplied by the given Supplier to this collection of Handlers.

      Parameters:
      supplier - the Handler supplier
    • setHandlers

      void setHandlers(List<Handler> handlers)

      Sets the given Handlers as children of this collection of Handlers.

      The list is copied and any subsequent modification to the list does not have any effect on this Handler.

      Any existing children Handler is removed.

      Parameters:
      handlers - the Handler to set as children
    • setHandlers

      default void setHandlers(Handler... handlers)

      Similar to setHandlers(List).

      Parameters:
      handlers - the Handler to set as children