Class PTraversal<S,T,A,B>
java.lang.Object
io.atlassian.fugue.optic.PTraversal<S,T,A,B>
- Type Parameters:
S- the source of aPTraversalT- the modified source of aPTraversalA- the target of aPTraversalB- the modified target of aPTraversal
- Direct Known Subclasses:
Traversal
A
PTraversal can be seen as a POptional generalised to 0 to n
targets where n can be infinite.
PTraversal stands for Polymorphic Traversal as it set and modify
methods change a type `A` to `B` and `S` to `T`. Traversal is a
PTraversal restricted to monomorphic updates.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptioncheck if all targets satisfy the predicateasFold()view aPTraversalas aFoldasSetter()view aPTraversalas aPSettercomposeFold(Fold<A, C> other) compose aPTraversalwith aFoldcomposeFold(Getter<A, C> other) compose aPTraversalwith aGetterfinal <C,D> PTraversal <S, T, C, D> composeIso(PIso<A, B, C, D> other) compose aPTraversalwith aPIsofinal <C,D> PTraversal <S, T, C, D> composeLens(PLens<A, B, C, D> other) compose aPTraversalwith aPLensfinal <C,D> PTraversal <S, T, C, D> composeOptional(POptional<A, B, C, D> other) compose aPTraversalwith aPOptionalfinal <C,D> PTraversal <S, T, C, D> composePrism(PPrism<A, B, C, D> other) compose aPTraversalwith aPPrismcomposeSetter(PSetter<A, B, C, D> other) compose aPTraversalwith aPSetterfinal <C,D> PTraversal <S, T, C, D> composeTraversal(PTraversal<A, B, C, D> other) compose aPTraversalwith aPTraversalcheck if at least one target satisfies the predicatefind the first target of aPTraversalmatching the predicatecombine all targets using a target'sMonoidmap each target to aMonoidand combine the resultsprivate static <S,T, A, B> PTraversal <S, T, A, B> fromCurried(PTraversal<S, Function<B, T>, A, B> curriedTraversal, Function<S, A> lastGet) get all the targets of aPTraversalheadOption(S s) get the first target of aPTraversalmodify polymorphically the target of aPTraversalwith a functionmodifyEitherF(Function<A, Either<L, B>> f) modify polymorphically the target of aPTraversalwith an Applicative functionmodifyFunctionF(Function<A, Function<C, B>> f) modify polymorphically the target of aPTraversalwith an Applicative functionmodifyIterableF(Function<A, Iterable<B>> f) modify polymorphically the target of aPTraversalwith an Applicative functionmodifyOptionF(Function<A, Option<B>> f) modify polymorphically the target of aPTraversalwith an Applicative functionmodify polymorphically the target of aPTraversalwith an Applicative functionmodifySupplierF(Function<A, Supplier<B>> f) modify polymorphically the target of aPTraversalwith an Applicative functionstatic <S,T> PTraversal <Either<S, S>, Either<T, T>, S, T> static <S,T> PTraversal <S, T, S, T> pId()static <S,T, A, B> PTraversal <S, T, A, B> pTraversal(Function<S, A> get1, Function<S, A> get2, BiFunction<B, B, Function<S, T>> set) static <S,T, A, B> PTraversal <S, T, A, B> pTraversal(Function<S, A> get1, Function<S, A> get2, Function<S, A> get3, Function<B, Function<B, Function<B, Function<S, T>>>> set) static <S,T, A, B> PTraversal <S, T, A, B> pTraversal(Function<S, A> get1, Function<S, A> get2, Function<S, A> get3, Function<S, A> get4, Function<B, Function<B, Function<B, Function<B, Function<S, T>>>>> set) static <S,T, A, B> PTraversal <S, T, A, B> pTraversal(Function<S, A> get1, Function<S, A> get2, Function<S, A> get3, Function<S, A> get4, Function<S, A> get5, Function<B, Function<B, Function<B, Function<B, Function<B, Function<S, T>>>>>> set) static <S,T, A, B> PTraversal <S, T, A, B> pTraversal(Function<S, A> get1, Function<S, A> get2, Function<S, A> get3, Function<S, A> get4, Function<S, A> get5, Function<S, A> get6, Function<B, Function<B, Function<B, Function<B, Function<B, Function<B, Function<S, T>>>>>>> set) set polymorphically the target of aPTraversalwith a valuesum(PTraversal<S1, T1, A, B> other) join twoPTraversalwith the same target
-
Constructor Details
-
PTraversal
public PTraversal()
-
-
Method Details
-
modifyFunctionF
-
modifyEitherF
-
modifyOptionF
-
modifyIterableF
-
modifySupplierF
-
modifyPairF
-
foldMap
-
fold
-
getAll
get all the targets of aPTraversal -
find
-
headOption
get the first target of aPTraversal -
exist
-
all
-
modify
-
set
set polymorphically the target of aPTraversalwith a value -
sum
join twoPTraversalwith the same target -
composeFold
-
composeFold
-
composeSetter
-
composeTraversal
compose aPTraversalwith aPTraversal -
composeOptional
compose aPTraversalwith aPOptional -
composePrism
compose aPTraversalwith aPPrism -
composeLens
compose aPTraversalwith aPLens -
composeIso
compose aPTraversalwith aPIso -
asFold
view aPTraversalas aFold -
asSetter
-
pId
-
pCodiagonal
-
pTraversal
public static <S,T, PTraversal<S,A, B> T, pTraversalA, B> (Function<S, A> get1, Function<S, A> get2, BiFunction<B, B, Function<S, T>> set) -
pTraversal
-
pTraversal
-
pTraversal
-
pTraversal
-
fromCurried
private static <S,T, PTraversal<S,A, B> T, fromCurriedA, B> (PTraversal<S, Function<B, T>, A, B> curriedTraversal, Function<S, A> lastGet)
-