Package org.empirewar.orbis.util
Record Class EnumCodec<E extends Enum<E>>
java.lang.Object
java.lang.Record
org.empirewar.orbis.util.EnumCodec<E>
- All Implemented Interfaces:
com.mojang.serialization.Codec<E>,com.mojang.serialization.codecs.PrimitiveCodec<E>,com.mojang.serialization.Decoder<E>,com.mojang.serialization.Encoder<E>
-
Nested Class Summary
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 -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionclazz()Returns the value of theclazzrecord component.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.<T> com.mojang.serialization.DataResult<E> read(com.mojang.serialization.DynamicOps<T> dynamicOps, T t) final StringtoString()Returns a string representation of this record class.<T> TMethods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods 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, xmapMethods inherited from interface com.mojang.serialization.Decoder
boxed, decode, flatMap, map, parse, parse, simple, terminalMethods inherited from interface com.mojang.serialization.Encoder
comap, encodeStart, flatComapMethods inherited from interface com.mojang.serialization.codecs.PrimitiveCodec
decode, encode
-
Constructor Details
-
EnumCodec
Creates an instance of aEnumCodecrecord class.- Parameters:
clazz- the value for theclazzrecord component
-
-
Method Details
-
read
public <T> com.mojang.serialization.DataResult<E> read(com.mojang.serialization.DynamicOps<T> dynamicOps, T t) -
write
-
toString
Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components. -
hashCode
public final int hashCode()Returns a hash code value for this object. The value is derived from the hash code of each of the record components. -
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). -
clazz
Returns the value of theclazzrecord component.- Returns:
- the value of the
clazzrecord component
-