Interface Either.Projection<A,​B,​L,​R>

    • Method Detail

      • either

        Either<L,​R> either()
        The either value underlying this projection.
        Returns:
        The either value underlying this projection.
      • toOption

        Option<? super A> toOption()
        Returns this projection's value in Some if it exists, otherwise None.
        Returns:
        This projection's value in Some if it exists, otherwise None.
      • toOptional

        java.util.Optional<? super A> toOptional()
        Returns this projection's value in Optional.of(T) if it exists, otherwise Optional.empty().
        Returns:
        This projection's value in of if it exists, otherwise empty.
        Since:
        4.0
      • toStream

        java.util.stream.Stream<? super A> toStream()
        Returns this projection's value in Stream.of(T) if it exists, otherwise Stream.empty().
        Returns:
        This projection's value in of if it exists, otherwise empty.
        Since:
        4.5.0
      • on

        A on​(java.util.function.Function<? super B,​? extends A> f)
        The value of this projection or the result of the given function on the opposing projection's value.
        Parameters:
        f - The function to execute if this projection has no value.
        Returns:
        The value of this projection or the result of the given function on the opposing projection's value.