Package fj.data

Class Either.Left<A,B>

java.lang.Object
fj.data.Either<A,B>
fj.data.Either.Left<A,B>
Enclosing class:
Either<A,B>

private static final class Either.Left<A,B> extends Either<A,B>
  • Field Details

    • a

      private final A a
  • Constructor Details

    • Left

      Left(A a)
  • Method Details

    • isLeft

      public boolean isLeft()
      Description copied from class: Either
      Returns true if this either is a left, false otherwise.
      Specified by:
      isLeft in class Either<A,B>
      Returns:
      true if this either is a left, false otherwise.
    • isRight

      public boolean isRight()
      Description copied from class: Either
      Returns true if this either is a right, false otherwise.
      Specified by:
      isRight in class Either<A,B>
      Returns:
      true if this either is a right, false otherwise.
    • either

      public <X> X either(F<A,X> left, F<B,X> right)
      Description copied from class: Either
      The catamorphism for either. Folds over this either breaking into left or right.
      Specified by:
      either in class Either<A,B>
      Parameters:
      left - The function to call if this is left.
      right - The function to call if this is right.
      Returns:
      The reduced value.