T - The type of the valuepublic class EitherEntry<T>
extends java.lang.Object
RegistryEntry or a value of type T.Either| Constructor | Description |
|---|---|
EitherEntry(net.lenni0451.mcstructs.converter.model.Either<RegistryEntry,T> either) |
|
EitherEntry(RegistryEntry entry) |
|
EitherEntry(T value) |
| Modifier and Type | Method | Description |
|---|---|---|
static <T> net.lenni0451.mcstructs.converter.codec.Codec<EitherEntry<T>> |
codec(Registry registry,
net.lenni0451.mcstructs.converter.codec.Codec<T> codec) |
Create a codec for this class bound to the given registry.
|
net.lenni0451.mcstructs.converter.model.Either<RegistryEntry,T> |
either() |
Convert this either to a
Either. |
RegistryEntry |
getLeft() |
|
T |
getRight() |
|
boolean |
isLeft() |
|
boolean |
isRight() |
|
java.lang.String |
toString() |
public EitherEntry(net.lenni0451.mcstructs.converter.model.Either<RegistryEntry,T> either)
public EitherEntry(@Nonnull
RegistryEntry entry)
public EitherEntry(@Nonnull
T value)
public static <T> net.lenni0451.mcstructs.converter.codec.Codec<EitherEntry<T>> codec(Registry registry, net.lenni0451.mcstructs.converter.codec.Codec<T> codec)
T - The type of the valueregistry - The registry owning the entrycodec - The codec for the valuepublic boolean isLeft()
RegistryEntrypublic RegistryEntry getLeft()
RegistryEntryjava.lang.IllegalStateException - If this either is not a RegistryEntrypublic boolean isRight()
public T getRight()
java.lang.IllegalStateException - If this either is not a valuepublic net.lenni0451.mcstructs.converter.model.Either<RegistryEntry,T> either()
Either.public java.lang.String toString()
toString in class java.lang.Object