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