public static class FluentFunctions.FluentFunction<T,R> extends java.lang.Object implements java.util.function.Function<T,R>, Reader<T,R>
Constructor and Description |
---|
FluentFunction(java.util.function.Function<T,R> fn) |
Modifier and Type | Method and Description |
---|---|
FluentFunctions.FluentFunction<T,R> |
after(java.util.function.BiConsumer<T,R> action) |
R |
apply(T t) |
FluentFunctions.FluentFunction<T,R> |
around(java.util.function.Function<FluentFunctions.Advice1<T,R>,R> around) |
java.util.concurrent.CompletableFuture<FluentFunctions.FluentFunction<T,R>> |
async(java.util.concurrent.Executor ex) |
FluentFunctions.FluentFunction<T,R> |
before(java.util.function.Consumer<T> action) |
<R1> FluentFunctions.FluentFunction<T,R1> |
flatMap(java.util.function.Function<? super R,? extends Reader<T,R1>> f) |
ReactiveSeq<R> |
generate(T input) |
ReactiveSeq<R> |
iterate(T seed,
java.util.function.Function<R,T> mapToType)
Generate an infinite Stream that iterates from the specified seed using the currently wrapped function
e.g.
|
FluentFunctions.FluentFunction<java.util.Optional<T>,java.util.Optional<R>> |
lift() |
FluentFunctions.FluentFunction<T,java.util.concurrent.CompletableFuture<R>> |
liftAsync(java.util.concurrent.Executor ex) |
FluentFunctions.FluentFunction<AnyM<T>,AnyM<R>> |
liftM() |
<X extends java.lang.Throwable> |
liftTry(java.lang.Class<X>... classes) |
FluentFunctions.FluentFunction<T,R> |
log(java.util.function.Consumer<java.lang.String> logger,
java.util.function.Consumer<java.lang.Throwable> error) |
<R1> FluentFunctions.FluentFunction<T,R1> |
map(java.util.function.Function<? super R,? extends R1> f2) |
<R1> FluentFunctions.FluentFunction<T,R1> |
matches(java.util.function.Function<Matchable.CheckValues<R,R1>,Matchable.CheckValues<R,R1>> case1,
java.util.function.Supplier<? extends R1> otherwise) |
FluentFunctions.FluentFunction<T,R> |
memoize() |
FluentFunctions.FluentFunction<T,R> |
memoize(Cacheable<R> cache) |
FluentFunctions.FluentFunction<T,R> |
name(java.lang.String name) |
FluentFunctions.FluentSupplier<R> |
partiallyApply(T param) |
FluentFunctions.FluentFunction<T,R> |
println() |
<X extends java.lang.Throwable> |
recover(java.lang.Class<X> type,
java.util.function.Function<T,R> onError) |
FluentFunctions.FluentFunction<T,R> |
retry(int times,
int backoffStartTime) |
public <R1> FluentFunctions.FluentFunction<T,R1> map(java.util.function.Function<? super R,? extends R1> f2)
public <R1> FluentFunctions.FluentFunction<T,R1> flatMap(java.util.function.Function<? super R,? extends Reader<T,R1>> f)
public FluentFunctions.FluentFunction<T,R> before(java.util.function.Consumer<T> action)
public FluentFunctions.FluentFunction<T,R> after(java.util.function.BiConsumer<T,R> action)
public FluentFunctions.FluentFunction<T,R> around(java.util.function.Function<FluentFunctions.Advice1<T,R>,R> around)
public FluentFunctions.FluentSupplier<R> partiallyApply(T param)
public FluentFunctions.FluentFunction<T,R> memoize()
public FluentFunctions.FluentFunction<T,R> memoize(Cacheable<R> cache)
public FluentFunctions.FluentFunction<T,R> name(java.lang.String name)
public FluentFunctions.FluentFunction<T,R> log(java.util.function.Consumer<java.lang.String> logger, java.util.function.Consumer<java.lang.Throwable> error)
public FluentFunctions.FluentFunction<T,R> println()
public <X extends java.lang.Throwable> FluentFunctions.FluentFunction<T,R> recover(java.lang.Class<X> type, java.util.function.Function<T,R> onError)
public FluentFunctions.FluentFunction<T,R> retry(int times, int backoffStartTime)
public <R1> FluentFunctions.FluentFunction<T,R1> matches(java.util.function.Function<Matchable.CheckValues<R,R1>,Matchable.CheckValues<R,R1>> case1, java.util.function.Supplier<? extends R1> otherwise)
public ReactiveSeq<R> iterate(T seed, java.util.function.Function<R,T> mapToType)
FluentFunctions.of(this::addOne)
.iterate(95281,i->i)
.forEach(System.out::println);
//95282
//95283
//95284
//95285
//95286
//etc
seed
- initial valuemapToType
- Convert from supplied functions return type to Stream input typepublic ReactiveSeq<R> generate(T input)
public FluentFunctions.FluentFunction<java.util.Optional<T>,java.util.Optional<R>> lift()
public <X extends java.lang.Throwable> FluentFunctions.FluentFunction<T,Try<R,X>> liftTry(java.lang.Class<X>... classes)
public FluentFunctions.FluentFunction<AnyM<T>,AnyM<R>> liftM()
public FluentFunctions.FluentFunction<T,java.util.concurrent.CompletableFuture<R>> liftAsync(java.util.concurrent.Executor ex)
public java.util.concurrent.CompletableFuture<FluentFunctions.FluentFunction<T,R>> async(java.util.concurrent.Executor ex)