T - The type of the consumed subjectsEX - The throwable type that consume(Object) may throwpublic interface ConsumerWhichThrows<T,EX extends java.lang.Throwable>
Consumer, but the consume(Object) method is permitted to throw a given exception.
When using this type in a variable, parameter or field declaration, never write:
ConsumerWhichThrows<consumed-type, thrown-exception>
, but always:
ConsumerWhichThrows<? super consumed-type, ? extends thrown-exception>
| Modifier and Type | Method and Description |
|---|---|
void |
consume(T subject)
Consumes one
subject of type T. |
void consume(T subject) throws EX extends java.lang.Throwable
subject of type T.
Generally subjects should either be immutable, or the 'ownership' of the product should pass from the caller to the consumer. Particularly, the consumer should not be called with one (mutable) instance more than once.
EX extends java.lang.Throwable