Interface Either<L,R>

All Known Implementing Classes:
Either.Left, Either.Right

public sealed interface Either<L,R> permits Either.Left<L,R>, Either.Right<L,R>
  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Interface
    Description
    static final record 
     
    static final record 
     
  • Method Summary

    Modifier and Type
    Method
    Description
    static <V> V
    identity(Either<? extends V, ? extends V> either)
     
    static <L,R> Either<L,R>
    left(L value)
     
    static <L,R> Either<L,R>
    right(R value)
     
    default <T extends @UnknownNullability Object>
    T
    unify(Function<? super L, ? extends T> leftMapper, Function<? super R, ? extends T> rightMapper)
     
  • Method Details

    • left

      static <L,R> Either<L,R> left(L value)
    • right

      static <L,R> Either<L,R> right(R value)
    • identity

      static <V> V identity(Either<? extends V, ? extends V> either)
    • unify

      default <T extends @UnknownNullability Object> T unify(Function<? super L, ? extends T> leftMapper, Function<? super R, ? extends T> rightMapper)