T
- The type of the consumed subjectsEX
- The throwable type that consume(Object)
may throw; use NoException
to indicate that
consume(Object)
does not declare any checked exceptionspublic interface ConsumerWhichThrows<T,EX extends 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 Throwable
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.
Copyright © 2018 Arno Unkrig. All rights reserved.