V - Result type.@FunctionalInterface public static interface Throwing.Supplier<V> extends Supplier<V>
Supplier.| Modifier and Type | Method and Description |
|---|---|
default V |
get() |
default <X extends Throwable> |
onFailure(Class<X> type,
Consumer<X> action)
Apply this function and run the given action in case of exception.
|
default Throwing.Supplier<V> |
onFailure(Consumer<Throwable> action)
Apply this function and run the given action in case of exception.
|
default Throwing.Supplier<V> |
orElse(Throwing.Supplier<V> defaultValue)
Apply this function and returns the given default value in case of exception.
|
default Throwing.Supplier<V> |
orElse(V defaultValue)
Apply this function and returns the given default value in case of exception.
|
default <X extends Throwable> |
recover(Class<? extends X> type,
Function<X,V> fn)
Apply this function or recover from a specific exception in case of exception.
|
default Throwing.Supplier<V> |
recover(Function<Throwable,V> fn)
Apply this function or recover from it in case of exception.
|
default Throwing.Supplier<V> |
singleton()
Singleton version of this supplier.
|
V |
tryGet() |
default <X extends Throwable> |
unwrap(Class<? extends X> type)
Apply this function and unwrap any resulting exception.
|
default Throwing.Supplier<V> |
wrap(Function<Throwable,Exception> wrapper)
Apply this function and wrap any resulting exception.
|
default Throwing.Supplier<V> onFailure(Consumer<Throwable> action)
action - Action to run when exception occurs.default <X extends Throwable> Throwing.Supplier<V> onFailure(Class<X> type, Consumer<X> action)
X - Exception type.type - Exception filter.action - Action to run when exception occurs.default Throwing.Supplier<V> wrap(Function<Throwable,Exception> wrapper)
wrapper - Exception wrapper.default <X extends Throwable> Throwing.Supplier<V> unwrap(Class<? extends X> type)
X - Exception type.type - Exception to unwrap.default Throwing.Supplier<V> orElse(V defaultValue)
defaultValue - Exceptional default value.default Throwing.Supplier<V> orElse(Throwing.Supplier<V> defaultValue)
defaultValue - Exceptional default value.default Throwing.Supplier<V> recover(Function<Throwable,V> fn)
fn - Exception recover.default <X extends Throwable> Throwing.Supplier<V> recover(Class<? extends X> type, Function<X,V> fn)
X - Exception type.type - Exception filter.fn - Exception recover.default Throwing.Supplier<V> singleton()
Copyright © 2017. All rights reserved.