Package gollorum.signpost.utils
Klasse Either<Left,Right>
java.lang.Object
gollorum.signpost.utils.Either<Left,Right>
-
Methodenübersicht
Modifizierer und TypMethodeBeschreibungstatic <Left,Right>
com.mojang.serialization.Codec<Either<Left, Right>> codec(com.mojang.serialization.Codec<Left> leftCodec, com.mojang.serialization.Codec<Right> rightCodec) abstract voidflatMapLeft(Function<Left, Either<NewLeft, Right>> mapping) flatMapRight(Function<Right, Either<Left, NewRight>> mapping) flip()static <Left,Right>
Either<Left, Right> fromMojangEither(com.mojang.datafixers.util.Either<Left, Right> mojangEither) abstract booleanisLeft()booleanisRight()static <Left,Right>
Either<Left, Right> left(Left left) static <Left,Right>
Either<Left, Right> leftIfPresent(Optional<Left> left, Supplier<Right> right) abstract Leftabstract <Out> Outstatic <Left,Right>
Either<Left, Right> right(Right right) static <Left,Right>
Either<Left, Right> rightIfPresent(Optional<Right> right, Supplier<Left> left) abstract Rightstatic <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)
-
Methodendetails
-
left
-
right
-
leftIfPresent
-
rightIfPresent
-
fromMojangEither
public static <Left,Right> Either<Left,Right> fromMojangEither(com.mojang.datafixers.util.Either<Left, Right> mojangEither) -
toMojangEither
-
isLeft
public abstract boolean isLeft() -
isRight
public boolean isRight() -
flip
-
rightOr
-
leftOr
-
flatMapRight
-
flatMapLeft
-
mapRight
-
mapLeft
-
match
-
consume
-
rightOrThrow
-
leftOrThrow
-
streamCodec
public static <Left,Right, net.minecraft.network.codec.StreamCodec<TBuf,TBuf extends io.netty.buffer.ByteBuf> Either<Left, streamCodecRight>> (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)
-