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

All Superinterfaces:
Effect.Applicant<A>, Iterable<A>, Maybe<A>
All Known Implementing Classes:
Either.AbstractProjection, Either.LeftProjection, Either.RightProjection
Enclosing class:
Either<L,R>

public static interface Either.Projection<A,B,L,R> extends Maybe<A>
  • Method Details

    • 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

      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

      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(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.