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