Class Xor<L,​R>

  • Type Parameters:
    L - type of the left value
    R - type of the right value
    Direct Known Subclasses:
    Xor.Left, Xor.Right

    public abstract class Xor<L,​R>
    extends java.lang.Object
    Right biased disjunction mainly based on the Xor type from scala cats library. This type is used for collecting salt errors that are in the place of a normal result.
    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class Description
      static class  Xor.Left<L,​R>
      Left branch of the Xor
      static class  Xor.Right<L,​R>
      Right branch of the Xor
    • Constructor Summary

      Constructors 
      Constructor Description
      Xor()  
    • Method Summary

      All Methods Static Methods Instance Methods Abstract Methods Concrete Methods 
      Modifier and Type Method Description
      abstract void consume​(java.util.function.Consumer<? super L> consumerLeft, java.util.function.Consumer<? super R> consumerRight)  
      abstract boolean exists​(java.util.function.Predicate<R> p)  
      abstract <T> Xor<? super L,​T> flatMap​(java.util.function.Function<? super R,​Xor<? super L,​T>> mapper)  
      abstract <T> T fold​(java.util.function.Function<? super L,​? extends T> mapLeft, java.util.function.Function<? super R,​? extends T> mapRight)  
      abstract R getOrElse​(java.util.function.Supplier<? extends R> supplier)  
      abstract boolean isLeft()  
      abstract boolean isRight()  
      abstract java.util.Optional<L> left()  
      static <L,​R>
      Xor.Left<L,​R>
      left​(L value)  
      abstract <T> Xor<L,​T> map​(java.util.function.Function<? super R,​? extends T> mapper)  
      java.util.Optional<R> option()  
      abstract R orElse​(R value)  
      abstract java.util.Optional<R> right()  
      static <L,​R>
      Xor.Right<L,​R>
      right​(R value)  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • Xor

        public Xor()
    • Method Detail

      • left

        public static <L,​R> Xor.Left<L,​R> left​(L value)
      • right

        public static <L,​R> Xor.Right<L,​R> right​(R value)
      • isRight

        public abstract boolean isRight()
      • isLeft

        public abstract boolean isLeft()
      • fold

        public abstract <T> T fold​(java.util.function.Function<? super L,​? extends T> mapLeft,
                                   java.util.function.Function<? super R,​? extends T> mapRight)
      • consume

        public abstract void consume​(java.util.function.Consumer<? super L> consumerLeft,
                                     java.util.function.Consumer<? super R> consumerRight)
      • map

        public abstract <T> Xor<L,​T> map​(java.util.function.Function<? super R,​? extends T> mapper)
      • flatMap

        public abstract <T> Xor<? super L,​T> flatMap​(java.util.function.Function<? super R,​Xor<? super L,​T>> mapper)
      • left

        public abstract java.util.Optional<L> left()
      • right

        public abstract java.util.Optional<R> right()
      • orElse

        public abstract R orElse​(R value)
      • getOrElse

        public abstract R getOrElse​(java.util.function.Supplier<? extends R> supplier)
      • exists

        public abstract boolean exists​(java.util.function.Predicate<R> p)
      • option

        public final java.util.Optional<R> option()