Class SetLens
- java.lang.Object
-
- com.jnape.palatable.lambda.optics.lenses.SetLens
-
public final class SetLens extends java.lang.ObjectLenses that operate onSets.
-
-
Constructor Summary
Constructors Modifier Constructor Description privateSetLens()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static <A> Lens.Simple<java.util.Set<A>,java.lang.Boolean>contains(A a)A lens that focuses on whether aSetcontains some valuea.static <A,SetA extends java.util.Set<A>>
Lens.Simple<SetA,java.lang.Boolean>contains(Fn1<? super SetA,? extends SetA> copyFn, A a)A lens that focuses on whether aSetcontains some valuea.
-
-
-
Method Detail
-
contains
public static <A,SetA extends java.util.Set<A>> Lens.Simple<SetA,java.lang.Boolean> contains(Fn1<? super SetA,? extends SetA> copyFn, A a)
A lens that focuses on whether aSetcontains some valuea. Note thatcopyFnis used to avoid mutating theSetin 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
public static <A> Lens.Simple<java.util.Set<A>,java.lang.Boolean> contains(A a)
A lens that focuses on whether aSetcontains some valuea. Likecontains(Fn1, Object)but with an implicit copy function that produces.HashSets- 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
-
-