T - The type of the valuepublic class Holder<T>
extends java.lang.Object
RegistryEntry or a value of type T.Either| Constructor and Description |
|---|
Holder(com.viaversion.viaversion.libs.mcstructs.converter.model.Either<RegistryEntry,T> either) |
Holder(RegistryEntry entry) |
Holder(T value) |
| Modifier and Type | Method and Description |
|---|---|
com.viaversion.viaversion.libs.mcstructs.converter.model.Either<RegistryEntry,T> |
either()
Convert this either to a
Either. |
static <T> com.viaversion.viaversion.libs.mcstructs.converter.codec.Codec<Holder<T>> |
fileCodec(Registry registry,
com.viaversion.viaversion.libs.mcstructs.converter.codec.Codec<T> codec) |
static <T> com.viaversion.viaversion.libs.mcstructs.converter.codec.Codec<Holder<T>> |
fixedCodec(Registry registry) |
RegistryEntry |
getEntry() |
T |
getValue() |
boolean |
isEntry() |
boolean |
isValue() |
java.lang.String |
toString() |
public Holder(com.viaversion.viaversion.libs.mcstructs.converter.model.Either<RegistryEntry,T> either)
public Holder(@Nonnull
RegistryEntry entry)
public Holder(@Nonnull
T value)
public static <T> com.viaversion.viaversion.libs.mcstructs.converter.codec.Codec<Holder<T>> fileCodec(Registry registry, com.viaversion.viaversion.libs.mcstructs.converter.codec.Codec<T> codec)
public static <T> com.viaversion.viaversion.libs.mcstructs.converter.codec.Codec<Holder<T>> fixedCodec(Registry registry)
public boolean isEntry()
RegistryEntrypublic RegistryEntry getEntry()
RegistryEntryjava.lang.IllegalStateException - If this either is not a RegistryEntrypublic boolean isValue()
public T getValue()
java.lang.IllegalStateException - If this either is not a valuepublic com.viaversion.viaversion.libs.mcstructs.converter.model.Either<RegistryEntry,T> either()
Either.public java.lang.String toString()
toString in class java.lang.Object