Class Either<L,R>

java.lang.Object
com.mojang.datafixers.util.Either<L,R>
All Implemented Interfaces:
App<Either.Mu<R>,L>

public abstract class Either<L,R> extends Object implements App<Either.Mu<R>,L>
  • Method Details

    • unbox

      public static <L, R> Either<L,R> unbox(App<Either.Mu<R>,L> box)
    • mapBoth

      public abstract <C, D> Either<C,D> mapBoth(Function<? super L,? extends C> f1, Function<? super R,? extends D> f2)
    • map

      public abstract <T> T map(Function<? super L,? extends T> l, Function<? super R,? extends T> r)
    • ifLeft

      public abstract Either<L,R> ifLeft(Consumer<? super L> consumer)
    • ifRight

      public abstract Either<L,R> ifRight(Consumer<? super R> consumer)
    • left

      public abstract Optional<L> left()
    • right

      public abstract Optional<R> right()
    • mapLeft

      public <T> Either<T,R> mapLeft(Function<? super L,? extends T> l)
    • mapRight

      public <T> Either<L,T> mapRight(Function<? super R,? extends T> l)
    • left

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

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

      public L orThrow()
    • swap

      public Either<R,L> swap()
    • flatMap

      public <L2> Either<L2,R> flatMap(Function<L,Either<L2,R>> function)