public static class FluentFunctions.FluentSupplier<R> extends java.lang.Object implements Fn0<R>
Fn0.FunctionalOperations<R>, Fn0.Instances, Fn0.SupplierKind<R>| Constructor and Description |
|---|
FluentSupplier(java.util.function.Supplier<R> fn) |
| Modifier and Type | Method and Description |
|---|---|
FluentFunctions.FluentSupplier<R> |
after(java.util.function.Consumer<R> action)
Apply after advice to this Supplier
|
FluentFunctions.FluentSupplier<R> |
around(java.util.function.Function<FluentFunctions.Advice0<R>,R> around)
Apply around advice to this Supplier
|
java.util.concurrent.CompletableFuture<FluentFunctions.FluentSupplier<R>> |
async(java.util.concurrent.Executor ex) |
FluentFunctions.FluentSupplier<R> |
before(java.lang.Runnable r)
Apply before advice to this Supplier
|
ReactiveSeq<R> |
generate() |
R |
get() |
FluentFunctions.FluentSupplier<java.util.concurrent.CompletableFuture<R>> |
liftAsync(java.util.concurrent.Executor ex) |
<X extends java.lang.Throwable> |
liftTry(java.lang.Class<X>... classes) |
FluentFunctions.FluentSupplier<R> |
log(java.util.function.Consumer<java.lang.String> logger,
java.util.function.Consumer<java.lang.Throwable> error)
A supplier that logs it's success or error states to the provided Consumers
|
FluentFunctions.FluentSupplier<R> |
memoize() |
FluentFunctions.FluentSupplier<R> |
memoize(Cacheable<R> cache) |
FluentFunctions.FluentSupplier<R> |
name(java.lang.String name) |
FluentFunctions.FluentSupplier<R> |
println() |
<X extends java.lang.Throwable> |
recover(java.lang.Class<X> type,
java.util.function.Supplier<R> onError)
A supplier that can recover from the specified exception types, using the provided Supplier
|
FluentFunctions.FluentSupplier<R> |
retry(int times,
int backoffStartTime)
A supplier capable of retrying on failure using an exponential backoff strategy
|
public FluentSupplier(java.util.function.Supplier<R> fn)
public FluentFunctions.FluentSupplier<R> before(java.lang.Runnable r)
r - Runnable that represents before advice (AOP)public FluentFunctions.FluentSupplier<R> after(java.util.function.Consumer<R> action)
action - Runnable that represents after advice (AOP)public FluentFunctions.FluentSupplier<R> around(java.util.function.Function<FluentFunctions.Advice0<R>,R> around)
around - Function that captures input to this Supplier and can optionally pass on the callpublic FluentFunctions.FluentSupplier<R> memoize()
public FluentFunctions.FluentSupplier<R> memoize(Cacheable<R> cache)
public FluentFunctions.FluentSupplier<R> name(java.lang.String name)
name - To give this supplierpublic FluentFunctions.FluentSupplier<R> println()
public FluentFunctions.FluentSupplier<R> log(java.util.function.Consumer<java.lang.String> logger, java.util.function.Consumer<java.lang.Throwable> error)
logger - Success loggererror - Failure loggerpublic <X extends java.lang.Throwable> FluentFunctions.FluentSupplier<R> recover(java.lang.Class<X> type, java.util.function.Supplier<R> onError)
type - Recoverable exception typesonError - Supplier to use on errorpublic FluentFunctions.FluentSupplier<R> retry(int times, int backoffStartTime)
times - Number of times to retrybackoffStartTime - Wait time before first retrypublic ReactiveSeq<R> generate()
public <X extends java.lang.Throwable> FluentFunctions.FluentSupplier<Try<R,X>> liftTry(java.lang.Class<X>... classes)
classes - To catch exceptions forpublic FluentFunctions.FluentSupplier<java.util.concurrent.CompletableFuture<R>> liftAsync(java.util.concurrent.Executor ex)
ex - Executor to execute this Supplier onpublic java.util.concurrent.CompletableFuture<FluentFunctions.FluentSupplier<R>> async(java.util.concurrent.Executor ex)
ex - Executor to execute this Supplier on