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