de.unkrig.commons.lang.protocol
Interface ConsumerWhichThrows<T,EX extends java.lang.Throwable>

Type Parameters:
T - The type of the consumed subjects
EX - The throwable type that consume(Object) may throw

public interface ConsumerWhichThrows<T,EX extends java.lang.Throwable>

Like Consumer, but the consume(Object) method is permitted to throw a given exception.

IMPORTANT NOTICE:

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>
.


Method Summary
 void consume(T subject)
          Consumes one subject of type T.
 

Method Detail

consume

void consume(T subject)
             throws EX extends java.lang.Throwable
Consumes one 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.

Throws:
EX extends java.lang.Throwable