Class Xor.Right<L,​R>

  • Type Parameters:
    L - type of the left value
    R - type of the right value
    Enclosing class:
    Xor<L,​R>

    public static final class Xor.Right<L,​R>
    extends Xor<L,​R>
    Right branch of the Xor
    • Nested Class Summary

    • Field Summary

      Fields 
      Modifier and Type Field Description
      private R right  
    • Constructor Summary

      Constructors 
      Modifier Constructor Description
      private Right​(R right)  
    • Method Summary

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

        clone, finalize, getClass, notify, notifyAll, wait, wait, wait
    • Field Detail

      • right

        private final R right
    • Constructor Detail

      • Right

        private Right​(R right)
    • Method Detail

      • isRight

        public boolean isRight()
        Specified by:
        isRight in class Xor<L,​R>
      • isLeft

        public boolean isLeft()
        Specified by:
        isLeft in class Xor<L,​R>
      • left

        public java.util.Optional<L> left()
        Specified by:
        left in class Xor<L,​R>
      • right

        public java.util.Optional<R> right()
        Specified by:
        right in class Xor<L,​R>
      • map

        public <T> Xor<L,​T> map​(java.util.function.Function<? super R,​? extends T> mapper)
        Specified by:
        map in class Xor<L,​R>
      • flatMap

        public <T> Xor<? super L,​T> flatMap​(java.util.function.Function<? super R,​Xor<? super L,​T>> mapper)
        Specified by:
        flatMap in class Xor<L,​R>
      • leftMap

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

        public <T> T fold​(java.util.function.Function<? super L,​? extends T> mapLeft,
                          java.util.function.Function<? super R,​? extends T> mapRight)
        Specified by:
        fold in class Xor<L,​R>
      • consume

        public void consume​(java.util.function.Consumer<? super L> consumerLeft,
                            java.util.function.Consumer<? super R> consumerRight)
        Specified by:
        consume in class Xor<L,​R>
      • exists

        public boolean exists​(java.util.function.Predicate<R> p)
        Specified by:
        exists in class Xor<L,​R>
      • orElse

        public R orElse​(R value)
        Specified by:
        orElse in class Xor<L,​R>
      • getOrElse

        public R getOrElse​(java.util.function.Supplier<? extends R> supplier)
        Specified by:
        getOrElse in class Xor<L,​R>
      • toString

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

        public int hashCode()
        Overrides:
        hashCode in class java.lang.Object
      • equals

        public boolean equals​(java.lang.Object obj)
        Overrides:
        equals in class java.lang.Object