/*
 * @author Ranides Atterwim <ranides@gmail.com>
 * @copyright Ranides Atterwim
 * @license WTFPL
 * @url http://ranides.net/projects/assira
 */

package net.ranides.assira.functional;

import net.ranides.assira.trace.ExceptionUtils;

/**
 *
 * @author Ranides Atterwim <ranides@gmail.com>
 */
public interface CheckedConsumer<T,E extends Exception> {

    void accept(T value) throws E;
    
    default void $accept(T value) {
        try {
            accept(value);
        } catch(Exception cause) {
            throw ExceptionUtils.rethrow(cause);
        }
    }

}
