V - Input type.@FunctionalInterface public static interface Throwing.Consumer<V> extends Consumer<V>
Consumer.
This class rethrow any exception using the Throwing.sneakyThrow(Throwable) technique.| Modifier and Type | Method and Description |
|---|---|
default void |
accept(V v) |
default <V1 extends V,X extends Throwable> |
onFailure(Class<? extends X> type,
Consumer<X> action)
Execute the given action before throwing the exception.
|
default <V1 extends V> |
onFailure(Consumer<Throwable> action)
Execute the given action before throwing the exception.
|
void |
tryAccept(V value)
Performs this operation on the given argument.
|
default <V1 extends V,X extends Throwable> |
unwrap(Class<? extends X> type)
Unwrap an exception and rethrow.
|
default <V1 extends V> |
wrap(Function<Throwable,Exception> wrapper)
Wrap an exception as new exception provided by the given wrap function.
|
void tryAccept(V value) throws Throwable
value - Argument.Throwable - If something goes wrong.default <V1 extends V> Throwing.Consumer<V1> onFailure(Consumer<Throwable> action)
V1 - Input type.action - Action to execute.default <V1 extends V,X extends Throwable> Throwing.Consumer<V1> onFailure(Class<? extends X> type, Consumer<X> action)
X - Exception type.V1 - Input type.type - Exception type filter.action - Action to execute.default <V1 extends V> Throwing.Consumer<V1> wrap(Function<Throwable,Exception> wrapper)
V1 - Input typewrapper - Wrap function.default <V1 extends V,X extends Throwable> Throwing.Consumer<V1> unwrap(Class<? extends X> type)
V1 - Input typeX - Exception type.type - Type to unwrap.Copyright © 2017. All rights reserved.