| Modifier and Type | Method and Description |
|---|---|
Lens<S,A> |
asLens()
|
Optional<S,A> |
asOptional()
|
Prism<S,A> |
asPrism()
|
Setter<S,A> |
asSetter()
|
Traversal<S,A> |
asTraversal()
|
<C> Iso<S,C> |
composeIso(Iso<A,C> other)
|
<C> Lens<S,C> |
composeLens(Lens<A,C> other)
|
<C> Optional<S,C> |
composeOptional(Optional<A,C> other)
|
<C> Prism<S,C> |
composePrism(Prism<A,C> other)
|
<C> Setter<S,C> |
composeSetter(Setter<A,C> other)
|
<C> Traversal<S,C> |
composeTraversal(Traversal<A,C> other)
|
<C> Iso<P2<S,C>,P2<A,C>> |
first() |
A |
get(S s)
get the target of a
PIso |
static <S> Iso<S,S> |
id()
create an
Iso between any type and itself. id is the zero element of optics composition, for all optics o of type O
(e.g. |
static <S,A> Iso<S,A> |
iso(F<S,A> get,
F<A,S> reverseGet)
create an
Iso using a pair of functions: one to get the target and one to get the source. |
<S1,A1> Iso<P2<S,S1>,P2<A,A1>> |
product(Iso<S1,A1> other)
pair two disjoint
Iso |
Iso<A,S> |
reverse()
reverse a
PIso: the source becomes the target and the target becomes the source |
S |
reverseGet(A a)
get the modified source of a
PIso |
<C> Iso<P2<C,S>,P2<C,A>> |
second() |
asFold, asGetter, composeFold, composeGetter, composeIso, composeLens, composeOptional, composePrism, composeSetter, composeTraversal, modify, modifyEitherF, modifyFunctionF, modifyIOF, modifyListF, modifyOptionF, modifyP1F, modifyPromiseF, modifyStreamF, modifyTrampolineF, modifyV2F, modifyValidationF, pId, pIso, product, setpublic S reverseGet(A a)
PIsoPIsopublic Iso<A,S> reverse()
PIsoPIso: the source becomes the target and the target becomes the sourcepublic static <S,A> Iso<S,A> iso(F<S,A> get, F<A,S> reverseGet)
Iso using a pair of functions: one to get the target and one to get the source.