Package com.github.dakusui.exception
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>
A manager class of an ExceptionContext.
-
Constructor Summary
ConstructorsConstructorDescriptionManager()Creates an object of this class.Manager(ExceptionContext.Factory<K> factory) Creates an object of this class using a givenfactory. -
Method Summary
Modifier and TypeMethodDescriptionvoidclose(ExceptionContext<K> context) Closes a givencontext.current()Returns a current context.final ExceptionContext<K> open(ExceptionContext.Entry<K>... entries) Creates a new exception context as a child of the current one.
-
Constructor Details
-
Manager
public Manager()Creates an object of this class. This internally calls
Manager(Factory)constructor with a newFactoryobject.- See Also:
-
Manager
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
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
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
Returns a current context.
- Returns:
- A current context.
-