@Override public void doAccept(final double value) throws Throwable { throwing.doAccept(value); }
@Override public void doAccept(final double value) throws Throwable { throwing.doAccept(value); }
public DoubleConsumer orDoNothing() { return value -> { try { throwing.doAccept(value); } catch (Error | RuntimeException e) { throw e; } catch (Throwable ignored) { // nothing } }; } }
public DoubleConsumer orDoNothing() { return value -> { try { throwing.doAccept(value); } catch (Error | RuntimeException e) { throw e; } catch (Throwable ignored) { // nothing } }; } }
@Override public DoubleConsumerChainer orTryWith( final ThrowingDoubleConsumer other) { final ThrowingDoubleConsumer consumer = value -> { try { throwing.doAccept(value); } catch (Error | RuntimeException e) { throw e; } catch (Throwable ignored) { other.doAccept(value); } }; return new DoubleConsumerChainer(consumer); }
@Override public DoubleConsumerChainer orTryWith( final ThrowingDoubleConsumer other) { final ThrowingDoubleConsumer consumer = value -> { try { throwing.doAccept(value); } catch (Error | RuntimeException e) { throw e; } catch (Throwable ignored) { other.doAccept(value); } }; return new DoubleConsumerChainer(consumer); }
@Override default void accept(double value) { try { doAccept(value); } catch (Error | RuntimeException e) { throw e; } catch (Throwable throwable) { throw new ThrownByLambdaException(throwable); } } }
@Override public DoubleConsumer sneakyThrow() { return value -> { try { throwing.doAccept(value); } catch (Error | RuntimeException e) { throw e; } catch (Throwable throwable) { throw doSneakyThrow(throwable); } }; }
@Override default void accept(double value) { try { doAccept(value); } catch (Error | RuntimeException e) { throw e; } catch (Throwable throwable) { throw new ThrownByLambdaException(throwable); } } }
@Override public DoubleConsumer fallbackTo(final DoubleConsumer fallback) { return value -> { try { throwing.doAccept(value); } catch (Error | RuntimeException e) { throw e; } catch (Throwable ignored) { fallback.accept(value); } }; }
@Override public DoubleConsumer fallbackTo(final DoubleConsumer fallback) { return value -> { try { throwing.doAccept(value); } catch (Error | RuntimeException e) { throw e; } catch (Throwable ignored) { fallback.accept(value); } }; }
@Override public DoubleConsumer sneakyThrow() { return value -> { try { throwing.doAccept(value); } catch (Error | RuntimeException e) { throw e; } catch (Throwable throwable) { throw doSneakyThrow(throwable); } }; }
@Override public <E extends RuntimeException> ThrowingDoubleConsumer 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 <E extends RuntimeException> ThrowingDoubleConsumer 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 protected void configureAlternate(final ThrowingDoubleConsumer throwing) throws Throwable { doAnswer(ignored -> { sentinel.set(ret2); return null; }) .when(throwing).doAccept(value); }
@Override protected void configureFull(final ThrowingDoubleConsumer throwing) throws Throwable { doAnswer(ignored -> { sentinel.set(ret1); return null; }) .doThrow(checked) .doThrow(unchecked) .doThrow(error) .when(throwing).doAccept(value); }