Package fj.data.optic

Class Getter<S,​A>

  • Type Parameters:
    S - the source of a Getter
    A - the target of a Getter

    public abstract class Getter<S,​A>
    extends java.lang.Object
    A Getter can be seen as a glorified get method between a type S and a type A. A Getter is also a valid Fold
    • Constructor Detail

      • Getter

        Getter()
    • Method Detail

      • get

        public abstract A get​(S s)
        get the target of a Getter
      • product

        public final <S1,​A1> Getter<P2<S,​S1>,​P2<A,​A1>> product​(Getter<S1,​A1> other)
        pair two disjoint Getter
      • first

        public final <B> Getter<P2<S,​B>,​P2<A,​B>> first()
      • second

        public final <B> Getter<P2<B,​S>,​P2<B,​A>> second()
      • composeFold

        public final <B> Fold<S,​B> composeFold​(Fold<A,​B> other)
        compose a Getter with a Fold
      • composePrism

        public final <B,​C,​D> Fold<S,​C> composePrism​(PPrism<A,​B,​C,​D> other)
        compose a Getter with a PPrism
      • composeLens

        public final <B,​C,​D> Getter<S,​C> composeLens​(PLens<A,​B,​C,​D> other)
        compose a Getter with a PLens
      • composeIso

        public final <B,​C,​D> Getter<S,​C> composeIso​(PIso<A,​B,​C,​D> other)
        compose a Getter with a PIso
      • id

        public static <A> Getter<A,​A> id()
      • codiagonal

        public static <A> Getter<Either<A,​A>,​A> codiagonal()
      • getter

        public static <S,​A> Getter<S,​A> getter​(F<S,​A> get)