Class Either<A,​B>

  • All Implemented Interfaces:
    java.lang.Iterable<B>

    public class Either<A,​B>
    extends java.lang.Object
    implements java.lang.Iterable<B>
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      boolean isLeft()  
      boolean isRight()  
      java.util.Iterator<B> iterator()  
      A left()  
      static <A,​B>
      Either<A,​B>
      left​(A a)  
      <R> R map​(java.util.function.Function<? super B,​? extends R> mapper)  
      <R> R mapLeft​(java.util.function.Function<? super A,​? extends R> mapper)  
      B right()  
      static <A,​B>
      Either<A,​B>
      right​(B b)  
      java.util.stream.Stream<B> stream()  
      java.lang.String toString()  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
      • Methods inherited from interface java.lang.Iterable

        forEach, spliterator
    • Method Detail

      • left

        public static <A,​B> Either<A,​B> left​(A a)
      • right

        public static <A,​B> Either<A,​B> right​(B b)
      • isLeft

        public boolean isLeft()
      • isRight

        public boolean isRight()
      • left

        public A left()
      • right

        public B right()
      • map

        public <R> R map​(java.util.function.Function<? super B,​? extends R> mapper)
      • mapLeft

        public <R> R mapLeft​(java.util.function.Function<? super A,​? extends R> mapper)
      • iterator

        public java.util.Iterator<B> iterator()
        Specified by:
        iterator in interface java.lang.Iterable<A>
      • stream

        public java.util.stream.Stream<B> stream()
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object