@Override public void doAccept(final T t) throws Throwable { throwing.doAccept(t); }
public Consumer<T> orDoNothing() { return t -> { try { throwing.doAccept(t); } catch (Error | RuntimeException e) { throw e; } catch (Throwable ignored) { // nothing } }; } }
@Override public void doAccept(final T t) throws Throwable { throwing.doAccept(t); }
public Consumer<T> orDoNothing() { return t -> { try { throwing.doAccept(t); } catch (Error | RuntimeException e) { throw e; } catch (Throwable ignored) { // nothing } }; } }
@Override public Consumer<T> fallbackTo(final Consumer<T> fallback) { return t -> { try { throwing.doAccept(t); } catch (Error | RuntimeException e) { throw e; } catch (Throwable ignored) { fallback.accept(t); } }; }
@Override public Consumer<T> fallbackTo(final Consumer<T> fallback) { return t -> { try { throwing.doAccept(t); } catch (Error | RuntimeException e) { throw e; } catch (Throwable ignored) { fallback.accept(t); } }; }
@Override public Consumer<T> sneakyThrow() { return t -> { try { throwing.doAccept(t); } catch (Error | RuntimeException e) { throw e; } catch (Throwable throwable) { throw doSneakyThrow(throwable); } }; }
default void accept(T t) { try { doAccept(t); } catch (Error | RuntimeException e) { throw e; } catch (Throwable throwable) { throw new ThrownByLambdaException(throwable); } } }
default void accept(T t) { try { doAccept(t); } catch (Error | RuntimeException e) { throw e; } catch (Throwable throwable) { throw new ThrownByLambdaException(throwable); } } }
@Override public Consumer<T> sneakyThrow() { return t -> { try { throwing.doAccept(t); } catch (Error | RuntimeException e) { throw e; } catch (Throwable throwable) { throw doSneakyThrow(throwable); } }; }
@Override public <E extends RuntimeException> ThrowingConsumer<T> orThrow( final Class<E> exclass) { return t -> { try { throwing.doAccept(t); } catch (Error | RuntimeException e) { throw e; } catch (Throwable throwable) { throw rethrow(exclass, throwable); } }; }
@Override public <E extends RuntimeException> ThrowingConsumer<T> orThrow( final Class<E> exclass) { return t -> { try { throwing.doAccept(t); } catch (Error | RuntimeException e) { throw e; } catch (Throwable throwable) { throw rethrow(exclass, throwable); } }; }
@Override protected void configureAlternate(final ThrowingConsumer<Type1> throwing) throws Throwable { doAnswer(invocation -> { sentinel.set(ret2); return null; }) .when(throwing).doAccept(t); }
@Override protected void configureFull(final ThrowingConsumer<Type1> throwing) throws Throwable { doAnswer(invocation -> { sentinel.set(ret1); return null; }) .doThrow(checked) .doThrow(unchecked) .doThrow(error) .when(throwing).doAccept(t); }