Package io.atlassian.fugue.optic
Class Fold<S,A>
- java.lang.Object
-
- io.atlassian.fugue.optic.Fold<S,A>
-
-
Constructor Summary
Constructors Constructor Description Fold()
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description java.util.function.Function<S,java.lang.Boolean>all(java.util.function.Predicate<A> p)check if all targets satisfy the predicatestatic <A> Fold<Either<A,A>,A>codiagonal()<B> Fold<S,B>composeFold(Fold<A,B> other)<C> Fold<S,C>composeGetter(Getter<A,C> other)<B,C,D>
Fold<S,C>composeIso(PIso<A,B,C,D> other)<B,C,D>
Fold<S,C>composeLens(PLens<A,B,C,D> other)<B,C,D>
Fold<S,C>composeOptional(POptional<A,B,C,D> other)<B,C,D>
Fold<S,C>composePrism(PPrism<A,B,C,D> other)java.util.function.Predicate<S>exist(java.util.function.Predicate<A> p)check if at least one target satisfies the predicatejava.util.function.Function<S,Option<A>>find(java.util.function.Predicate<A> p)find the first target of aFoldmatching the predicatejava.util.function.Function<S,A>fold(Monoid<A> monoid)combine all targets using a target'sMonoidabstract <M> java.util.function.Function<S,M>foldMap(Monoid<M> monoid, java.util.function.Function<A,M> f)java.lang.Iterable<A>getAll(S s)get all the targets of aFoldOption<A>headOption(S s)get the first target of aFoldstatic <A> Fold<A,A>id()<S1> Fold<Either<S,S1>,A>sum(Fold<S1,A> other)join twoFoldwith the same target
-
-
-
Method Detail
-
foldMap
public abstract <M> java.util.function.Function<S,M> foldMap(Monoid<M> monoid, java.util.function.Function<A,M> f)
-
fold
public final java.util.function.Function<S,A> fold(Monoid<A> monoid)
combine all targets using a target'sMonoid
-
find
public final java.util.function.Function<S,Option<A>> find(java.util.function.Predicate<A> p)
find the first target of aFoldmatching the predicate
-
exist
public final java.util.function.Predicate<S> exist(java.util.function.Predicate<A> p)
check if at least one target satisfies the predicate
-
all
public final java.util.function.Function<S,java.lang.Boolean> all(java.util.function.Predicate<A> p)
check if all targets satisfy the predicate
-
sum
public final <S1> Fold<Either<S,S1>,A> sum(Fold<S1,A> other)
join twoFoldwith the same target
-
id
public static <A> Fold<A,A> id()
-
-