Package foundry.veil.api.util
Class EnumCodec<T extends Enum<?>>
java.lang.Object
foundry.veil.api.util.EnumCodec<T>
- Type Parameters:
T
- The enum type to encode/decode
- All Implemented Interfaces:
com.mojang.serialization.Codec<T>
,com.mojang.serialization.Decoder<T>
,com.mojang.serialization.Encoder<T>
public class EnumCodec<T extends Enum<?>>
extends Object
implements com.mojang.serialization.Codec<T>
Codec for serializing/deserializing enum constants.
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic class
EnumCodec.Builder<T extends Enum<?>>
Builder for creating a newEnumCodec
.Nested classes/interfaces inherited from interface com.mojang.serialization.Codec
com.mojang.serialization.Codec.RecursiveCodec<T>, com.mojang.serialization.Codec.ResultFunction<A>
Nested classes/interfaces inherited from interface com.mojang.serialization.Decoder
com.mojang.serialization.Decoder.Boxed<A>, com.mojang.serialization.Decoder.Simple<A>, com.mojang.serialization.Decoder.Terminal<A>
-
Field Summary
Fields inherited from interface com.mojang.serialization.Codec
BOOL, BYTE, BYTE_BUFFER, DOUBLE, EMPTY, FLOAT, INT, INT_STREAM, LONG, LONG_STREAM, PASSTHROUGH, SHORT, STRING
-
Method Summary
Modifier and TypeMethodDescriptionstatic <T extends Enum<?>>
EnumCodec.Builder<T> <T1> com.mojang.serialization.DataResult
<com.mojang.datafixers.util.Pair<T, T1>> decode
(com.mojang.serialization.DynamicOps<T1> ops, T1 input) <T1> com.mojang.serialization.DataResult
<T1> Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface com.mojang.serialization.Codec
comapFlatMap, deprecated, dispatch, dispatch, dispatchMap, dispatchMap, dispatchStable, fieldOf, flatComapMap, flatXmap, lenientOptionalFieldOf, lenientOptionalFieldOf, lenientOptionalFieldOf, lenientOptionalFieldOf, listOf, listOf, mapResult, optionalFieldOf, optionalFieldOf, optionalFieldOf, optionalFieldOf, orElse, orElse, orElse, orElseGet, orElseGet, orElseGet, partialDispatch, promotePartial, sizeLimitedListOf, stable, validate, withLifecycle, xmap
Methods inherited from interface com.mojang.serialization.Decoder
boxed, decode, flatMap, map, parse, parse, simple, terminal
Methods inherited from interface com.mojang.serialization.Encoder
comap, encodeStart, flatComap
-
Method Details