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 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.
    • 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​(Function<? super L,​? extends T> mapLeft,
                                   Function<? super R,​? extends T> mapRight)
      • consume

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

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

        public abstract <T> Xor<? super L,​T> flatMap​(Function<? super R,​Xor<? super L,​T>> mapper)
      • right

        public abstract Optional<R> right()
      • orElse

        public abstract R orElse​(R value)
      • getOrElse

        public abstract R getOrElse​(Supplier<? extends R> supplier)
      • exists

        public abstract boolean exists​(Predicate<R> p)