Class EnumCodec<E extends Enum<E>>
java.lang.Object
com.github.darksoulq.abyssallib.common.serialization.codecs.EnumCodec<E>
- Type Parameters:
E- Enum type.
- All Implemented Interfaces:
Codec<E>
-
Nested Class Summary
Nested classes/interfaces inherited from interface Codec
Codec.Decoder<T>, Codec.Encoder<T>, Codec.Pair<A,B>, Codec.Tuple3<A, B, C>, Codec.Tuple4<A, B, C, D> -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescription<R> Raccept(CodecVisitor<R> visitor) Routes this instance into the visitor API to construct contextual schema layouts.<D> DataResult<E> decode(DynamicOps<D> ops, D input) Decodes a serialized input of a specific data format into a Java object.describe()Outputs a structural description of the expected format for this codec.<D> DataResult<D> encode(DynamicOps<D> ops, E value) Encodes a Java object into its serialized representation.Methods inherited from class Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface Codec
collection, comapFlatMap, decodeAsync, describe, encodeAsync, fieldOf, flatComapMap, flatXmap, immutableList, immutableSet, list, maxLength, minLength, nullable, oneOf, optional, optionalFieldOf, optionalFieldOf, orElse, positive, range, regex, restrict, schema, set, structuralEquals, transform, unchecked, validate, validate, versioned, withSchema, xmap
-
Constructor Details
-
EnumCodec
-
-
Method Details
-
decode
Description copied from interface:CodecDecodes a serialized input of a specific data format into a Java object.- Specified by:
decodein interfaceCodec<E extends Enum<E>>- Type Parameters:
D- The type of the serialized data.- Parameters:
ops- The provider defining how to navigate and read data of type D.input- The raw serialized input to be processed.- Returns:
- A DataResult containing the decoded object or an error state.
-
encode
Description copied from interface:CodecEncodes a Java object into its serialized representation.- Specified by:
encodein interfaceCodec<E extends Enum<E>>- Type Parameters:
D- The target type of the serialized data.- Parameters:
ops- The provider defining how to construct data of type D.value- The Java object instance to be serialized.- Returns:
- A DataResult containing the serialized data or an error state.
-
describe
Description copied from interface:CodecOutputs a structural description of the expected format for this codec. Useful for schema generation and validation debugging. -
accept
Description copied from interface:CodecRoutes this instance into the visitor API to construct contextual schema layouts.
-