Klasse Either<Left,Right>

java.lang.Object
gollorum.signpost.utils.Either<Left,Right>

public abstract class Either<Left,Right> extends Object
  • Methodendetails

    • left

      public static <Left, Right> Either<Left,Right> left(Left left)
    • right

      public static <Left, Right> Either<Left,Right> right(Right right)
    • leftIfPresent

      public static <Left, Right> Either<Left,Right> leftIfPresent(Optional<Left> left, Supplier<Right> right)
    • rightIfPresent

      public static <Left, Right> Either<Left,Right> rightIfPresent(Optional<Right> right, Supplier<Left> left)
    • fromMojangEither

      public static <Left, Right> Either<Left,Right> fromMojangEither(com.mojang.datafixers.util.Either<Left,Right> mojangEither)
    • toMojangEither

      public com.mojang.datafixers.util.Either<Left,Right> toMojangEither()
    • isLeft

      public abstract boolean isLeft()
    • isRight

      public boolean isRight()
    • flip

      public Either<Right,Left> flip()
    • rightOr

      public abstract Right rightOr(Function<Left,Right> func)
    • leftOr

      public abstract Left leftOr(Function<Right,Left> func)
    • flatMapRight

      public abstract <NewRight> Either<Left,NewRight> flatMapRight(Function<Right,Either<Left,NewRight>> mapping)
    • flatMapLeft

      public abstract <NewLeft> Either<NewLeft,Right> flatMapLeft(Function<Left,Either<NewLeft,Right>> mapping)
    • mapRight

      public final <NewRight> Either<Left,NewRight> mapRight(Function<Right,NewRight> mapping)
    • mapLeft

      public final <NewLeft> Either<NewLeft,Right> mapLeft(Function<Left,NewLeft> mapping)
    • match

      public abstract <Out> Out match(Function<Left,Out> leftMapping, Function<Right,Out> rightMapping)
    • consume

      public abstract void consume(Consumer<Left> leftMapping, Consumer<Right> rightMapping)
    • rightOrThrow

      public Right rightOrThrow()
    • leftOrThrow

      public Left leftOrThrow()
    • streamCodec

      public static <Left, Right, TBuf extends io.netty.buffer.ByteBuf> net.minecraft.network.codec.StreamCodec<TBuf,Either<Left,Right>> streamCodec(net.minecraft.network.codec.StreamCodec<? super TBuf,Left> leftCodec, net.minecraft.network.codec.StreamCodec<? super TBuf,Right> rightCodec)
    • codec

      public static <Left, Right> com.mojang.serialization.Codec<Either<Left,Right>> codec(com.mojang.serialization.Codec<Left> leftCodec, com.mojang.serialization.Codec<Right> rightCodec)