public final class TypedOptic<S,T,A,B> extends Object
Modifier and Type | Field and Description |
---|---|
protected Type<A> |
aType |
protected Type<B> |
bType |
protected Set<TypeToken<? extends K1>> |
proofBounds |
protected Type<S> |
sType |
protected Type<T> |
tType |
Constructor and Description |
---|
TypedOptic(Set<TypeToken<? extends K1>> proofBounds,
Type<S> sType,
Type<T> tType,
Type<A> aType,
Type<B> bType,
Optic<?,S::A,T::B> optic) |
TypedOptic(TypeToken<? extends K1> proofBound,
Type<S> sType,
Type<T> tType,
Type<A> aType,
Type<B> bType,
Optic<?,S::A,T::B> optic) |
Modifier and Type | Method and Description |
---|---|
static <S,T> TypedOptic<S,T,S,T> |
adapter(Type<S> sType,
Type<T> tType) |
<P extends K2,Proof2 extends K1> |
apply(TypeToken<Proof2> token,
Proof2<P> proof,
P<A,B> argument) |
Type<A> |
aType() |
Set<TypeToken<? extends K1>> |
bounds() |
Type<B> |
bType() |
<A1,B1> TypedOptic<S,T,A1,B1> |
compose(TypedOptic<A,B,A1,B1> other) |
static <K,V,V2> TypedOptic<List<(K,V)>,List<(K,V2)>,V,V2> |
compoundListElements(Type<K> keyType,
Type<V> aType,
Type<V2> bType) |
static <K,V,K2> TypedOptic<List<(K,V)>,List<(K2,V)>,K,K2> |
compoundListKeys(Type<K> aType,
Type<K2> bType,
Type<V> valueType) |
static <F,G,F2> TypedOptic<(F|G),(F2|G),F,F2> |
inj1(Type<F> fType,
Type<G> gType,
Type<F2> newType) |
static <F,G,G2> TypedOptic<(F|G),(F|G2),G,G2> |
inj2(Type<F> fType,
Type<G> gType,
Type<G2> newType) |
static <Proof2 extends K1> |
instanceOf(Collection<TypeToken<? extends K1>> bounds,
TypeToken<Proof2> proof) |
static <A,B> TypedOptic<List<A>,List<B>,A,B> |
list(Type<A> aType,
Type<B> bType) |
Optic<?,S::A,T::B> |
optic() |
static <F,G,F2> TypedOptic<(F,G),(F2,G),F,F2> |
proj1(Type<F> fType,
Type<G> gType,
Type<F2> newType) |
static <F,G,G2> TypedOptic<(F,G),(F,G2),G,G2> |
proj2(Type<F> fType,
Type<G> gType,
Type<G2> newType) |
Type<S> |
sType() |
static <K,A,B> TypedOptic<(K,?),(K,?),A,B> |
tagged(TaggedChoice.TaggedChoiceType<K> sType,
K key,
Type<A> aType,
Type<B> bType) |
Type<T> |
tType() |
<Proof2 extends K1> |
upCast(TypeToken<Proof2> proof) |
public TypedOptic(TypeToken<? extends K1> proofBound, Type<S> sType, Type<T> tType, Type<A> aType, Type<B> bType, Optic<?,S::A,T::B> optic)
public <P extends K2,Proof2 extends K1> P<S,T> apply(TypeToken<Proof2> token, Proof2<P> proof, P<A,B> argument)
public <A1,B1> TypedOptic<S,T,A1,B1> compose(TypedOptic<A,B,A1,B1> other)
public <Proof2 extends K1> Optional<Optic<? super Proof2,S::A,T::B>> upCast(TypeToken<Proof2> proof)
public static <Proof2 extends K1> boolean instanceOf(Collection<TypeToken<? extends K1>> bounds, TypeToken<Proof2> proof)
public static <S,T> TypedOptic<S,T,S,T> adapter(Type<S> sType, Type<T> tType)
public static <F,G,F2> TypedOptic<(F,G),(F2,G),F,F2> proj1(Type<F> fType, Type<G> gType, Type<F2> newType)
public static <F,G,G2> TypedOptic<(F,G),(F,G2),G,G2> proj2(Type<F> fType, Type<G> gType, Type<G2> newType)
public static <F,G,F2> TypedOptic<(F|G),(F2|G),F,F2> inj1(Type<F> fType, Type<G> gType, Type<F2> newType)
public static <F,G,G2> TypedOptic<(F|G),(F|G2),G,G2> inj2(Type<F> fType, Type<G> gType, Type<G2> newType)
public static <K,V,K2> TypedOptic<List<(K,V)>,List<(K2,V)>,K,K2> compoundListKeys(Type<K> aType, Type<K2> bType, Type<V> valueType)
public static <K,V,V2> TypedOptic<List<(K,V)>,List<(K,V2)>,V,V2> compoundListElements(Type<K> keyType, Type<V> aType, Type<V2> bType)
public static <A,B> TypedOptic<List<A>,List<B>,A,B> list(Type<A> aType, Type<B> bType)
public static <K,A,B> TypedOptic<(K,?),(K,?),A,B> tagged(TaggedChoice.TaggedChoiceType<K> sType, K key, Type<A> aType, Type<B> bType)