Package com.petrolpark.core.codec
Record Class ContextualMapCodec.ContextualMapCodecCodec<CONTEXT,A>
java.lang.Object
java.lang.Record
com.petrolpark.core.codec.ContextualMapCodec.ContextualMapCodecCodec<CONTEXT,A>
- All Implemented Interfaces:
ContextualCodec<CONTEXT,,A> ContextualDecoder<CONTEXT,,A> ContextualEncoder<CONTEXT,A>
- Enclosing class:
ContextualMapCodec<CONTEXT,A>
public static record ContextualMapCodec.ContextualMapCodecCodec<CONTEXT,A> (ContextualMapCodec<CONTEXT,A> codec)
extends Record
implements ContextualCodec<CONTEXT,A>
-
Constructor Summary
ConstructorsConstructorDescriptionCreates an instance of aContextualMapCodecCodecrecord class. -
Method Summary
Modifier and TypeMethodDescriptioncodec()Returns the value of thecodecrecord component.<T> com.mojang.serialization.DataResult<com.mojang.datafixers.util.Pair<A, T>> <T> com.mojang.serialization.DataResult<T> final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.toString()Returns a string representation of this record class.Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface com.petrolpark.core.codec.ContextualCodec
fieldOf, flatContextualXmap, optionalFieldOf, withContext, xmapMethods inherited from interface com.petrolpark.core.codec.ContextualDecoder
decode, flatContextualMap, map, parse, parseMethods inherited from interface com.petrolpark.core.codec.ContextualEncoder
comap, encodeStart, flatContextualComap
-
Constructor Details
-
ContextualMapCodecCodec
Creates an instance of aContextualMapCodecCodecrecord class.- Parameters:
codec- the value for thecodecrecord component
-
-
Method Details
-
decode
public <T> com.mojang.serialization.DataResult<com.mojang.datafixers.util.Pair<A,T>> decode(com.mojang.serialization.DynamicOps<T> ops, CONTEXT context, T input) - Specified by:
decodein interfaceContextualDecoder<CONTEXT,A>
-
encode
public <T> com.mojang.serialization.DataResult<T> encode(A input, CONTEXT context, com.mojang.serialization.DynamicOps<T> ops, T prefix) - Specified by:
encodein interfaceContextualEncoder<CONTEXT,A>
-
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). -
codec
Returns the value of thecodecrecord component.- Returns:
- the value of the
codecrecord component
-