Interface Schema<Values extends HList>
-
- Type Parameters:
Values- theHListof values to focus on
- All Superinterfaces:
Applicative<HMap,Lens<HMap,?,Maybe<Values>,Maybe<Values>>>,Contravariant<HMap,Profunctor<?,HMap,Lens<?,?,Maybe<Values>,Maybe<Values>>>>,Functor<HMap,Lens<HMap,?,Maybe<Values>,Maybe<Values>>>,Lens<HMap,HMap,Maybe<Values>,Maybe<Values>>,Lens.Simple<HMap,Maybe<Values>>,Monad<HMap,Lens<HMap,?,Maybe<Values>,Maybe<Values>>>,MonadRec<HMap,Lens<HMap,?,Maybe<Values>,Maybe<Values>>>,Optic<Cartesian<?,?,?>,Functor<?,?>,HMap,HMap,Maybe<Values>,Maybe<Values>>,Optic.Simple<Cartesian<?,?,?>,Functor<?,?>,HMap,Maybe<Values>>,Profunctor<HMap,HMap,Lens<?,?,Maybe<Values>,Maybe<Values>>>
public interface Schema<Values extends HList> extends Lens.Simple<HMap,Maybe<Values>>
A lens that focuses on theheterogeneous listof values pointed at by one or moretypesafe keysthat must all exist in the sameHMapto be collectively extracted. Note that if any of the keys is absent in the map, the result will beMaybe.nothing().- See Also:
TypeSafeKey
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface com.jnape.palatable.lambda.optics.Lens
Lens.Simple<S,A>
-
Nested classes/interfaces inherited from interface com.jnape.palatable.lambda.optics.Optic
Optic.Simple<P extends Profunctor<?,?,? extends P>,F extends Functor<?,? extends F>,S,A>
-
-
Method Summary
All Methods Static Methods Instance Methods Default Methods Modifier and Type Method Description default <A,NewValues extends HList.HCons<A,Values>>
Schema<NewValues>add(TypeSafeKey<?,A> key)Add a newTypeSafeKeyto the head of thisSchema.static <A> Schema<SingletonHList<A>>schema(TypeSafeKey<?,A> key)Create aSchemafrom a singleTypeSafeKey.static <A,B>
Schema<Tuple2<A,B>>schema(TypeSafeKey<?,A> aKey, TypeSafeKey<?,B> bKey)Create aSchemafrom twoTypeSafeKeys.static <A,B,C>
Schema<Tuple3<A,B,C>>schema(TypeSafeKey<?,A> aKey, TypeSafeKey<?,B> bKey, TypeSafeKey<?,C> cKey)Create aSchemafrom threeTypeSafeKeys.static <A,B,C,D>
Schema<Tuple4<A,B,C,D>>schema(TypeSafeKey<?,A> aKey, TypeSafeKey<?,B> bKey, TypeSafeKey<?,C> cKey, TypeSafeKey<?,D> dKey)Create aSchemafrom fourTypeSafeKeys.static <A,B,C,D,E>
Schema<Tuple5<A,B,C,D,E>>schema(TypeSafeKey<?,A> aKey, TypeSafeKey<?,B> bKey, TypeSafeKey<?,C> cKey, TypeSafeKey<?,D> dKey, TypeSafeKey<?,E> eKey)Create aSchemafrom fiveTypeSafeKeys.static <A,B,C,D,E,F>
Schema<Tuple6<A,B,C,D,E,F>>schema(TypeSafeKey<?,A> aKey, TypeSafeKey<?,B> bKey, TypeSafeKey<?,C> cKey, TypeSafeKey<?,D> dKey, TypeSafeKey<?,E> eKey, TypeSafeKey<?,F> fKey)Create aSchemafrom sixTypeSafeKeys.static <A,B,C,D,E,F,G>
Schema<Tuple7<A,B,C,D,E,F,G>>schema(TypeSafeKey<?,A> aKey, TypeSafeKey<?,B> bKey, TypeSafeKey<?,C> cKey, TypeSafeKey<?,D> dKey, TypeSafeKey<?,E> eKey, TypeSafeKey<?,F> fKey, TypeSafeKey<?,G> gKey)Create aSchemafrom sevenTypeSafeKeys.static <A,B,C,D,E,F,G,H>
Schema<Tuple8<A,B,C,D,E,F,G,H>>schema(TypeSafeKey<?,A> aKey, TypeSafeKey<?,B> bKey, TypeSafeKey<?,C> cKey, TypeSafeKey<?,D> dKey, TypeSafeKey<?,E> eKey, TypeSafeKey<?,F> fKey, TypeSafeKey<?,G> gKey, TypeSafeKey<?,H> hKey)Create aSchemafrom eightTypeSafeKeys.-
Methods inherited from interface com.jnape.palatable.lambda.optics.Lens
andThen, compose, contraMap, diMap, diMapL, diMapR, discardL, discardR, flatMap, fmap, mapA, mapB, mapS, mapT, pure, toIso, trampolineM, zip
-
Methods inherited from interface com.jnape.palatable.lambda.optics.Lens.Simple
andThen, compose
-
Methods inherited from interface com.jnape.palatable.lambda.optics.Optic
apply, monomorphize
-
-
-
-
Method Detail
-
add
default <A,NewValues extends HList.HCons<A,Values>> Schema<NewValues> add(TypeSafeKey<?,A> key)
Add a newTypeSafeKeyto the head of thisSchema.- Type Parameters:
A- the value the head key focuses onNewValues- the newHList.HConsof values- Parameters:
key- the new head key- Returns:
- the updated
Schema
-
schema
static <A> Schema<SingletonHList<A>> schema(TypeSafeKey<?,A> key)
Create aSchemafrom a singleTypeSafeKey.- Type Parameters:
A- the type of value the key focuses on- Parameters:
key- theTypeSafeKey- Returns:
- the
Schema
-
schema
static <A,B> Schema<Tuple2<A,B>> schema(TypeSafeKey<?,A> aKey, TypeSafeKey<?,B> bKey)
Create aSchemafrom twoTypeSafeKeys.- Type Parameters:
A- the type of value the first key focuses onB- the type of value the second key focuses on- Parameters:
aKey- the firstTypeSafeKeybKey- the secondTypeSafeKey- Returns:
- the
Schema
-
schema
static <A,B,C> Schema<Tuple3<A,B,C>> schema(TypeSafeKey<?,A> aKey, TypeSafeKey<?,B> bKey, TypeSafeKey<?,C> cKey)
Create aSchemafrom threeTypeSafeKeys.- Type Parameters:
A- the type of value the first key focuses onB- the type of value the second key focuses onC- the type of value the third key focuses on- Parameters:
aKey- the firstTypeSafeKeybKey- the secondTypeSafeKeycKey- the thirdTypeSafeKey- Returns:
- the
Schema
-
schema
static <A,B,C,D> Schema<Tuple4<A,B,C,D>> schema(TypeSafeKey<?,A> aKey, TypeSafeKey<?,B> bKey, TypeSafeKey<?,C> cKey, TypeSafeKey<?,D> dKey)
Create aSchemafrom fourTypeSafeKeys.- Type Parameters:
A- the type of value the first key focuses onB- the type of value the second key focuses onC- the type of value the third key focuses onD- the type of value the fourth key focuses on- Parameters:
aKey- the firstTypeSafeKeybKey- the secondTypeSafeKeycKey- the thirdTypeSafeKeydKey- the fourthTypeSafeKey- Returns:
- the
Schema
-
schema
static <A,B,C,D,E> Schema<Tuple5<A,B,C,D,E>> schema(TypeSafeKey<?,A> aKey, TypeSafeKey<?,B> bKey, TypeSafeKey<?,C> cKey, TypeSafeKey<?,D> dKey, TypeSafeKey<?,E> eKey)
Create aSchemafrom fiveTypeSafeKeys.- Type Parameters:
A- the type of value the first key focuses onB- the type of value the second key focuses onC- the type of value the third key focuses onD- the type of value the fourth key focuses onE- the type of value the fifth key focuses on- Parameters:
aKey- the firstTypeSafeKeybKey- the secondTypeSafeKeycKey- the thirdTypeSafeKeydKey- the fourthTypeSafeKeyeKey- the fifthTypeSafeKey- Returns:
- the
Schema
-
schema
static <A,B,C,D,E,F> Schema<Tuple6<A,B,C,D,E,F>> schema(TypeSafeKey<?,A> aKey, TypeSafeKey<?,B> bKey, TypeSafeKey<?,C> cKey, TypeSafeKey<?,D> dKey, TypeSafeKey<?,E> eKey, TypeSafeKey<?,F> fKey)
Create aSchemafrom sixTypeSafeKeys.- Type Parameters:
A- the type of value the first key focuses onB- the type of value the second key focuses onC- the type of value the third key focuses onD- the type of value the fourth key focuses onE- the type of value the fifth key focuses onF- the type of value the sixth key focuses on- Parameters:
aKey- the firstTypeSafeKeybKey- the secondTypeSafeKeycKey- the thirdTypeSafeKeydKey- the fourthTypeSafeKeyeKey- the fifthTypeSafeKeyfKey- the sixthTypeSafeKey- Returns:
- the
Schema
-
schema
static <A,B,C,D,E,F,G> Schema<Tuple7<A,B,C,D,E,F,G>> schema(TypeSafeKey<?,A> aKey, TypeSafeKey<?,B> bKey, TypeSafeKey<?,C> cKey, TypeSafeKey<?,D> dKey, TypeSafeKey<?,E> eKey, TypeSafeKey<?,F> fKey, TypeSafeKey<?,G> gKey)
Create aSchemafrom sevenTypeSafeKeys.- Type Parameters:
A- the type of value the first key focuses onB- the type of value the second key focuses onC- the type of value the third key focuses onD- the type of value the fourth key focuses onE- the type of value the fifth key focuses onF- the type of value the sixth key focuses onG- the type of value the seventh key focuses on- Parameters:
aKey- the firstTypeSafeKeybKey- the secondTypeSafeKeycKey- the thirdTypeSafeKeydKey- the fourthTypeSafeKeyeKey- the fifthTypeSafeKeyfKey- the sixthTypeSafeKeygKey- the seventhTypeSafeKey- Returns:
- the
Schema
-
schema
static <A,B,C,D,E,F,G,H> Schema<Tuple8<A,B,C,D,E,F,G,H>> schema(TypeSafeKey<?,A> aKey, TypeSafeKey<?,B> bKey, TypeSafeKey<?,C> cKey, TypeSafeKey<?,D> dKey, TypeSafeKey<?,E> eKey, TypeSafeKey<?,F> fKey, TypeSafeKey<?,G> gKey, TypeSafeKey<?,H> hKey)
Create aSchemafrom eightTypeSafeKeys.- Type Parameters:
A- the type of value the first key focuses onB- the type of value the second key focuses onC- the type of value the third key focuses onD- the type of value the fourth key focuses onE- the type of value the fifth key focuses onF- the type of value the sixth key focuses onG- the type of value the seventh key focuses onH- the type of value the eighth key focuses on- Parameters:
aKey- the firstTypeSafeKeybKey- the secondTypeSafeKeycKey- the thirdTypeSafeKeydKey- the fourthTypeSafeKeyeKey- the fifthTypeSafeKeyfKey- the sixthTypeSafeKeygKey- the seventhTypeSafeKeyhKey- the eighthTypeSafeKey- Returns:
- the
Schema
-
-