Class SetLens
java.lang.Object
com.jnape.palatable.lambda.optics.lenses.SetLens
Lenses that operate on
Set
s.-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic <A> Lens.Simple
<Set<A>, Boolean> contains
(A a) A lens that focuses on whether aSet
contains some valuea
.static <A,
SetA extends Set<A>>
Lens.Simple<SetA, Boolean> A lens that focuses on whether aSet
contains some valuea
.
-
Constructor Details
-
SetLens
private SetLens()
-
-
Method Details
-
contains
public static <A,SetA extends Set<A>> Lens.Simple<SetA,Boolean> contains(Fn1<? super SetA, ? extends SetA> copyFn, A a) A lens that focuses on whether aSet
contains some valuea
. Note thatcopyFn
is used to avoid mutating theSet
in question.- Type Parameters:
A
- the value typeSetA
- the set to focus on- Parameters:
copyFn
- the copy functiona
- the value in question- Returns:
- a lens that focuses on a value's inclusion in a given
Set
-
contains
A lens that focuses on whether aSet
contains some valuea
. Likecontains(Fn1, Object)
but with an implicit copy function that produces
.HashSet
s- Type Parameters:
A
- the value type- Parameters:
a
- the value in question- Returns:
- a lens that focuses on a value's inclusion in a given
Set
-