Modifier and Type | Method and Description |
---|---|
Either<L,R> |
Either.filter(Fn1<? super R,? extends Boolean> pred,
Fn0<L> leftFn0)
If this is a right value, apply
pred to it. |
static <L,R> Either<L,R> |
Either.fromMaybe(Maybe<R> maybe,
Fn0<L> leftFn0)
Convert a
Maybe <R> into an Either<L, R> , supplying the left value from
leftFn in the case of Maybe.nothing() . |
A |
Maybe.orElseGet(Fn0<A> otherFn0)
If the value is present, return it; otherwise, return the value supplied by
otherSupplier . |
<E extends Throwable> |
Maybe.orElseThrow(Fn0<? extends E> throwableSupplier)
If the value is present, return it; otherwise, throw the
Throwable supplied by
throwableSupplier . |
<L> Either<L,A> |
Maybe.toEither(Fn0<L> lFn0)
If this value is absent, return the value supplied by
lSupplier wrapped in Either.left . |
static <A> Try<A> |
Try.trying(Fn0<? extends A> supplier)
|
static <R> Either<Throwable,R> |
Either.trying(Fn0<? extends R> fn0)
Attempt to execute the
Fn0 , returning its result in a right value. |
static <L,R> Either<L,R> |
Either.trying(Fn0<? extends R> fn0,
Fn1<? super Throwable,? extends L> leftFn)
Attempt to execute the
Fn0 , returning its result in a right value. |
static <A extends AutoCloseable,B extends AutoCloseable,C extends AutoCloseable,D> |
Try.withResources(Fn0<? extends A> fn0,
Fn1<? super A,? extends B> bFn,
Fn1<? super B,? extends C> cFn,
Fn1<? super C,? extends Try<? extends D>> fn)
Convenience overload of
withResources that
cascades
two dependent resource creations via nested calls. |
static <A extends AutoCloseable,B extends AutoCloseable,C> |
Try.withResources(Fn0<? extends A> fn0,
Fn1<? super A,? extends B> bFn,
Fn1<? super B,? extends Try<? extends C>> fn)
Convenience overload of
withResources that cascades dependent resource
creation via nested calls. |
static <A extends AutoCloseable,B> |
Try.withResources(Fn0<? extends A> fn0,
Fn1<? super A,? extends Try<? extends B>> fn)
Given a
aSupplier and an Fn1
fn , apply fn to the result of aSupplier , ensuring that the result has its
close method invoked, regardless of the outcome. |
Modifier and Type | Method and Description |
---|---|
default <B> Fn0<B> |
Fn0.diMapR(Fn1<? super A,? extends B> fn) |
default <B> Fn0<B> |
Fn0.discardL(Applicative<B,Fn1<Unit,?>> appB) |
default <B> Fn0<A> |
Fn0.discardR(Applicative<B,Fn1<Unit,?>> appB) |
default <B> Fn0<B> |
Fn0.flatMap(Fn1<? super A,? extends Monad<B,Fn1<Unit,?>>> f) |
default <B> Fn0<B> |
Fn0.fmap(Fn1<? super A,? extends B> f) |
static <A> Fn0<A> |
Fn0.fn0(Fn0<A> fn)
Static factory method for coercing a lambda to an
Fn0 . |
static <A> Fn0<A> |
Fn0.fn0(Fn1<Unit,A> fn)
|
static <A> Fn0<A> |
Fn0.fromCallable(Callable<A> callable)
|
static <A> Fn0<A> |
Fn0.fromSupplier(Supplier<A> supplier)
|
default <B> Fn0<B> |
Fn0.pure(B b) |
default Fn0<B> |
Fn1.thunk(A a)
|
default <B> Fn0<B> |
Fn0.zip(Applicative<Fn1<? super A,? extends B>,Fn1<Unit,?>> appFn) |
default <B> Fn0<B> |
Fn0.zip(Fn2<Unit,A,B> appFn) |
Modifier and Type | Method and Description |
---|---|
static <A> Fn0<A> |
Fn0.fn0(Fn0<A> fn)
Static factory method for coercing a lambda to an
Fn0 . |
Modifier and Type | Method and Description |
---|---|
C |
ToCollection.checkedApply(Fn0<C> cFn0,
Iterable<A> as) |
M |
ToMap.checkedApply(Fn0<M> mFn0,
Iterable<? extends Map.Entry<K,V>> entries) |
static <A,C extends Collection<A>> |
ToCollection.toCollection(Fn0<C> cFn0) |
static <A,C extends Collection<A>> |
ToCollection.toCollection(Fn0<C> cFn0,
Iterable<A> as) |
static <K,V,M extends Map<K,V>> |
ToMap.toMap(Fn0<M> mFn0) |
static <K,V,M extends Map<K,V>> |
ToMap.toMap(Fn0<M> mFn0,
Iterable<? extends Map.Entry<K,V>> entries) |
Modifier and Type | Method and Description |
---|---|
Iterable<A> |
RateLimit.checkedApply(Fn0<Instant> instantFn0,
Long limit,
Duration duration,
Iterable<A> as) |
static <A> Fn3<Long,Duration,Iterable<A>,Iterable<A>> |
RateLimit.rateLimit(Fn0<Instant> instantFn0) |
static <A> Fn2<Duration,Iterable<A>,Iterable<A>> |
RateLimit.rateLimit(Fn0<Instant> instantFn0,
Long limit) |
static <A> Fn1<Iterable<A>,Iterable<A>> |
RateLimit.rateLimit(Fn0<Instant> instantFn0,
Long limit,
Duration duration) |
static <A> Iterable<A> |
RateLimit.rateLimit(Fn0<Instant> instantFn0,
Long limit,
Duration duration,
Iterable<A> as) |
Modifier and Type | Method and Description |
---|---|
static <A> Lazy<A> |
Lazy.lazy(Fn0<A> fn0)
Wrap a computation in a lazy computation.
|
Constructor and Description |
---|
RateLimitingIterable(Iterable<A> as,
Set<Tuple3<Long,Duration,Fn0<Instant>>> rateLimits) |
RateLimitingIterator(Iterator<A> asIterator,
Set<Tuple3<Long,Duration,Fn0<Instant>>> rateLimits) |
Modifier and Type | Method and Description |
---|---|
static <A> IO<A> |
IO.externallyManaged(Fn0<CompletableFuture<A>> supplier)
Static factory method for creating an
IO from an externally managed source of
completable futures . |
static <A> IO<A> |
IO.io(Fn0<? extends A> fn0)
Static factory method for coercing a lambda to an
IO . |
Modifier and Type | Method and Description |
---|---|
static <A> Monoid<A> |
Monoid.monoid(Semigroup<A> semigroup,
Fn0<A> identityFn0) |
Modifier and Type | Method and Description |
---|---|
static <A,C extends Collection<A>> |
AddAll.addAll(Fn0<C> collectionFn0) |
static <A,C extends Collection<A>> |
AddAll.addAll(Fn0<C> collectionFn0,
C xs) |
static <A,C extends Collection<A>> |
AddAll.addAll(Fn0<C> collectionFn0,
C xs,
C ys) |
Monoid<C> |
AddAll.checkedApply(Fn0<C> cFn0) |
Monoid<Map<K,V>> |
MergeMaps.checkedApply(Fn0<Map<K,V>> mFn0,
Semigroup<V> semigroup) |
static <K,V> MonoidFactory<Semigroup<V>,Map<K,V>> |
MergeMaps.mergeMaps(Fn0<Map<K,V>> mFn0) |
static <K,V> Monoid<Map<K,V>> |
MergeMaps.mergeMaps(Fn0<Map<K,V>> mFn0,
Semigroup<V> semigroup) |
static <K,V> Fn1<Map<K,V>,Map<K,V>> |
MergeMaps.mergeMaps(Fn0<Map<K,V>> mFn0,
Semigroup<V> semigroup,
Map<K,V> x) |
static <K,V> Map<K,V> |
MergeMaps.mergeMaps(Fn0<Map<K,V>> mFn0,
Semigroup<V> semigroup,
Map<K,V> x,
Map<K,V> y) |