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