Class ExceptionContext.Manager<K extends ExceptionContext.Key>

java.lang.Object
com.github.dakusui.exception.ExceptionContext.Manager<K>
Type Parameters:
K - Type of key used by exception contexts managed under this object.
Enclosing interface:
ExceptionContext<K extends ExceptionContext.Key>

public static class ExceptionContext.Manager<K extends ExceptionContext.Key> extends Object

A manager class of an ExceptionContext.

  • Constructor Details

    • Manager

      public Manager()

      Creates an object of this class. This internally calls Manager(Factory) constructor with a new Factory object.

      See Also:
    • Manager

      public Manager(ExceptionContext.Factory<K> factory)

      Creates an object of this class using a given factory.

      Parameters:
      factory - A factory with which this object creates a new context.
  • Method Details

    • open

      @SafeVarargs public final ExceptionContext<K> open(ExceptionContext.Entry<K>... entries)

      Creates a new exception context as a child of the current one.

      Parameters:
      entries - Entries to be added to the new child context.
      Returns:
      A new context.
    • close

      public void close(ExceptionContext<K> context)

      Closes a given context. The current context will be set to a parent of the current one, if any.

      Parameters:
      context - A context to be closed
    • current

      public ExceptionContext<K> current()

      Returns a current context.

      Returns:
      A current context.