All Downloads are FREE. Search and download functionalities are using the official Maven repository.

au.csiro.sparkle.common.ThrowingConsumer Maven / Gradle / Ivy

The newest version!
package au.csiro.sparkle.common;

import java.util.function.Consumer;

public abstract class ThrowingConsumer {
	public abstract void accept(T t) throws Exception;

	public static  Consumer wrap(final ThrowingConsumer c) {
		return t -> {
            try {
                c.accept(t);
            } catch (Exception ex) {
                throw new RuntimeException(ex);
            }
        };
	}
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy