Record Class OneOfCodec<T>
java.lang.Object
java.lang.Record
com.github.darksoulq.abyssallib.common.serialization.codecs.OneOfCodec<T>
- Type Parameters:
T- Common value type.
- All Implemented Interfaces:
Codec<T>
-
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.codecs()Returns the available codec branches.<D> DataResult<T> 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, T value) Encodes a Java object into its serialized representation.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.final StringtoString()Returns a string representation of this record class.Methods 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
-
OneOfCodec
-
-
Method Details
-
codecs
-
decode
Description copied from interface:CodecDecodes a serialized input of a specific data format into a Java object. -
encode
Description copied from interface:CodecEncodes a Java object into its serialized representation. -
describe
-
accept
Description copied from interface:CodecRoutes this instance into the visitor API to construct contextual schema layouts. -
toString
-
hashCode
-
equals
Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. All components in this record class are compared withObjects::equals(Object,Object).
-