Package com.mojang.serialization.codecs
Class PairCodec<F,S>
java.lang.Object
com.mojang.serialization.codecs.PairCodec<F,S>
-
Nested Class Summary
Nested classes/interfaces inherited from interface com.mojang.serialization.Codec
Codec.ResultFunction<A>
Nested classes/interfaces inherited from interface com.mojang.serialization.Decoder
Decoder.Boxed<A>, Decoder.Simple<A>, 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
-
Method Summary
Modifier and TypeMethodDescription<T> DataResult<Pair<Pair<F,
S>, T>> decode
(DynamicOps<T> ops, T input) Decodes an object from a serialized form, returning any remaining serialized data.<T> DataResult<T>
encode
(Pair<F, S> value, DynamicOps<T> ops, T rest) Encodes an object to a serialized form, adding to an existing prefix.boolean
int
hashCode()
toString()
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
Methods 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, xmap
Methods inherited from interface com.mojang.serialization.Decoder
boxed, decode, flatMap, map, parse, parse, simple, terminal
Methods inherited from interface com.mojang.serialization.Encoder
comap, encodeStart, flatComap
-
Constructor Details
-
PairCodec
-
-
Method Details
-
decode
Description copied from interface:Decoder
Decodes an object from a serialized form, returning any remaining serialized data.- Specified by:
decode
in interfaceDecoder<F>
- Type Parameters:
T
- the type of the serialized form- Parameters:
ops
- aDynamicOps
for the serialized forminput
- the serialized form to decode- Returns:
- a
DataResult
containing the decoded object and any remaining serialized data, or an error if the object could not be decoded
-
encode
Description copied from interface:Encoder
Encodes an object to a serialized form, adding to an existing prefix.- Specified by:
encode
in interfaceEncoder<F>
- Type Parameters:
T
- the type to serialize to- Parameters:
value
- the object to encodeops
- aDynamicOps
for the target serialized formatrest
- existing data that the encoded object should be added to- Returns:
- a
DataResult
containing the serialized form of the object, or an error if the object could not be serialized
-
equals
-
hashCode
public int hashCode() -
toString
-