Class Either<L,R>

java.lang.Object
com.couchbase.client.core.util.Either<L,R>

@Internal public class Either<L,R> extends Object
  • Method Details

    • of

      public static <L, R> Either<L,R> of(@Nullable L left, @Nullable R right)
      Throws:
      IllegalArgumentException - if left and right are both null or both non-null
    • ofLeft

      public static <L, R> Either<L,R> ofLeft(L left)
    • ofRight

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

      public Optional<L> left()
    • right

      public Optional<R> right()
    • ifPresent

      public void ifPresent(Consumer<L> leftConsumer, Consumer<R> rightConsumer)
    • toString

      public String toString()
      Overrides:
      toString in class Object