Interface Context<T>
- Type Parameters:
T- the context value type
- All Superinterfaces:
AutoCloseable, Supplier<T>
- All Known Implementing Classes:
AbstractContext
Encapsulates some context that is applicable until
close().- Author:
- Paul Ferraro
-
Field Summary
Fields -
Method Summary
-
Field Details
-
EMPTY
An empty context
-
-
Method Details
-
close
void close()- Specified by:
closein interfaceAutoCloseable
-
empty
Returns an empty context.- Type Parameters:
T- the context value type- Returns:
- an empty context.
-
of
Returns a context that provides the specified value and invokes the specified task on close.- Type Parameters:
T- the context value type- Parameters:
value- the context valuecloseTask- the action to perform onclose().- Returns:
- a context that provides the specified value and invokes the specified task on close.
-