From 0f196f59c6a4cb76ab8409da62ff1f35505f94a8 Mon Sep 17 00:00:00 2001 From: Dico Karssiens Date: Sun, 11 Nov 2018 14:06:45 +0000 Subject: Changes I made before breaking my local repository. Hoping this works. --- .../checkedfunctions/CheckedBiConsumer.java | 138 ++++++++++----------- 1 file changed, 69 insertions(+), 69 deletions(-) (limited to 'dicore3/core/src/main/java/io/dico/dicore/exceptions/checkedfunctions/CheckedBiConsumer.java') diff --git a/dicore3/core/src/main/java/io/dico/dicore/exceptions/checkedfunctions/CheckedBiConsumer.java b/dicore3/core/src/main/java/io/dico/dicore/exceptions/checkedfunctions/CheckedBiConsumer.java index badf05b..bfcafe8 100644 --- a/dicore3/core/src/main/java/io/dico/dicore/exceptions/checkedfunctions/CheckedBiConsumer.java +++ b/dicore3/core/src/main/java/io/dico/dicore/exceptions/checkedfunctions/CheckedBiConsumer.java @@ -1,69 +1,69 @@ -package io.dico.dicore.exceptions.checkedfunctions; - -import io.dico.dicore.exceptions.ExceptionHandler; - -import java.util.function.BiConsumer; - -/** - * checked mimic of {@link BiConsumer} - * - * @param - * @param - * @param - */ -@FunctionalInterface -public interface CheckedBiConsumer - extends CheckedFunctionalObject, BiConsumer { - - /** - * The consuming action - * - * @param t the first argument to consume - * @param u the second argument to consume - * @throws TException if an exception occurs - */ - void checkedAccept(TParam1 t, TParam2 u) throws TException; - - /** - * unchecked wrapper for {@link #checkedAccept(Object, Object)} - * If a {@link TException} occurs, an unchecked one might be thrown by {@link #resultOnError(Throwable, Object...)} - * - * @param t the first input - * @param u the second input - * @see #checkedAccept(Object, Object) - * @see #resultOnError(Throwable, Object...) - */ - @Override - default void accept(TParam1 t, TParam2 u) { - try { - checkedAccept(t, u); - } catch (Throwable ex) { - handleGenericException(ex, t, u); - } - } - - /** - * {@inheritDoc} - */ - @Override - default CheckedBiConsumer handleExceptionsWith(ExceptionHandler handler) { - return new CheckedBiConsumer() { - @Override - public void checkedAccept(TParam1 t, TParam2 u) throws TException { - CheckedBiConsumer.this.checkedAccept(t, u); - } - - @Override - public Void handleGenericException(Throwable thrown, Object... args) { - handler.handleGenericException(thrown, args); - return null; - } - - @Override - public CheckedBiConsumer handleExceptionsWith(ExceptionHandler handler) { - return CheckedBiConsumer.this.handleExceptionsWith(handler); - } - }; - } - -} +package io.dico.dicore.exceptions.checkedfunctions; + +import io.dico.dicore.exceptions.ExceptionHandler; + +import java.util.function.BiConsumer; + +/** + * checked mimic of {@link BiConsumer} + * + * @param + * @param + * @param + */ +@FunctionalInterface +public interface CheckedBiConsumer + extends CheckedFunctionalObject, BiConsumer { + + /** + * The consuming action + * + * @param t the first argument to consume + * @param u the second argument to consume + * @throws TException if an exception occurs + */ + void checkedAccept(TParam1 t, TParam2 u) throws TException; + + /** + * unchecked wrapper for {@link #checkedAccept(Object, Object)} + * If a {@link TException} occurs, an unchecked one might be thrown by {@link #resultOnError(Throwable, Object...)} + * + * @param t the first input + * @param u the second input + * @see #checkedAccept(Object, Object) + * @see #resultOnError(Throwable, Object...) + */ + @Override + default void accept(TParam1 t, TParam2 u) { + try { + checkedAccept(t, u); + } catch (Throwable ex) { + handleGenericException(ex, t, u); + } + } + + /** + * {@inheritDoc} + */ + @Override + default CheckedBiConsumer handleExceptionsWith(ExceptionHandler handler) { + return new CheckedBiConsumer() { + @Override + public void checkedAccept(TParam1 t, TParam2 u) throws TException { + CheckedBiConsumer.this.checkedAccept(t, u); + } + + @Override + public Void handleGenericException(Throwable thrown, Object... args) { + handler.handleGenericException(thrown, args); + return null; + } + + @Override + public CheckedBiConsumer handleExceptionsWith(ExceptionHandler handler) { + return CheckedBiConsumer.this.handleExceptionsWith(handler); + } + }; + } + +} -- cgit v1.2.3