Package net.minecraft.util
Record Class ExtraCodecs.XorCodec<F,S>
java.lang.Object
java.lang.Record
net.minecraft.util.ExtraCodecs.XorCodec<F,S>
- All Implemented Interfaces:
com.mojang.serialization.Codec<com.mojang.datafixers.util.Either<F,,S>> com.mojang.serialization.Decoder<com.mojang.datafixers.util.Either<F,,S>> com.mojang.serialization.Encoder<com.mojang.datafixers.util.Either<F,S>>
- Enclosing class:
- ExtraCodecs
-
Nested Class Summary
Nested classes/interfaces inherited from interface com.mojang.serialization.Codec
com.mojang.serialization.Codec.ResultFunction<A extends Object> -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final com.mojang.serialization.Codec<F>The field for thefirstrecord component.private final com.mojang.serialization.Codec<S>The field for thesecondrecord component.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 TypeMethodDescription<T> com.mojang.serialization.DataResult<com.mojang.datafixers.util.Pair<com.mojang.datafixers.util.Either<F,S>, T>> decode(com.mojang.serialization.DynamicOps<T> p_144679_, T p_144680_) <T> com.mojang.serialization.DataResult<T>encode(com.mojang.datafixers.util.Either<F, S> p_144663_, com.mojang.serialization.DynamicOps<T> p_144664_, T p_144665_) final booleanIndicates whether some other object is "equal to" this one.com.mojang.serialization.Codec<F>first()Returns the value of thefirstrecord component.final inthashCode()Returns a hash code value for this object.com.mojang.serialization.Codec<S>second()Returns the value of thesecondrecord component.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.mojang.serialization.Codec
comapFlatMap, deprecated, dispatch, dispatch, dispatchMap, dispatchMap, dispatchStable, fieldOf, flatComapMap, flatXmap, listOf, mapResult, optionalFieldOf, optionalFieldOf, optionalFieldOf, optionalFieldOf, orElse, orElse, orElse, orElseGet, orElseGet, orElseGet, partialDispatch, promotePartial, stable, 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, flatComap
-
Field Details
-
first
The field for thefirstrecord component. -
second
The field for thesecondrecord component.
-
-
Constructor Details
-
XorCodec
Creates an instance of aXorCodecrecord class.- Parameters:
first- the value for thefirstrecord componentsecond- the value for thesecondrecord component
-
-
Method Details
-
decode
public <T> com.mojang.serialization.DataResult<com.mojang.datafixers.util.Pair<com.mojang.datafixers.util.Either<F,S>, decodeT>> (com.mojang.serialization.DynamicOps<T> p_144679_, T p_144680_) - Specified by:
decodein interfacecom.mojang.serialization.Decoder<F>
-
encode
public <T> com.mojang.serialization.DataResult<T> encode(com.mojang.datafixers.util.Either<F, S> p_144663_, com.mojang.serialization.DynamicOps<T> p_144664_, T p_144665_) - Specified by:
encodein interfacecom.mojang.serialization.Encoder<F>
-
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). -
first
Returns the value of thefirstrecord component.- Returns:
- the value of the
firstrecord component
-
second
Returns the value of thesecondrecord component.- Returns:
- the value of the
secondrecord component
-