Package dev.latvian.mods.klib.codec
Record Class UnboundMapStreamCodec<B extends io.netty.buffer.ByteBuf,K,V>
java.lang.Object
java.lang.Record
dev.latvian.mods.klib.codec.UnboundMapStreamCodec<B,K,V>
- All Implemented Interfaces:
KLibStreamCodec<B,,Map<K, V>> net.minecraft.network.codec.StreamCodec<B,,Map<K, V>> net.minecraft.network.codec.StreamDecoder<B,,Map<K, V>> net.minecraft.network.codec.StreamEncoder<B,Map<K, V>>
public record UnboundMapStreamCodec<B extends io.netty.buffer.ByteBuf,K,V> (net.minecraft.network.codec.StreamCodec<? super B extends io.netty.buffer.ByteBuf,K> keyCodec, net.minecraft.network.codec.StreamCodec<? super B extends io.netty.buffer.ByteBuf,V> valueCodec, boolean ordered, boolean identity)
extends Record
implements net.minecraft.network.codec.StreamCodec<B,Map<K,V>>
-
Nested Class Summary
Nested classes/interfaces inherited from interface net.minecraft.network.codec.StreamCodec
net.minecraft.network.codec.StreamCodec.CodecOperation<B,S, T> -
Constructor Summary
ConstructorsConstructorDescriptionUnboundMapStreamCodec(net.minecraft.network.codec.StreamCodec<? super B, K> keyCodec, net.minecraft.network.codec.StreamCodec<? super B, V> valueCodec, boolean ordered, boolean identity) Creates an instance of aUnboundMapStreamCodecrecord class. -
Method Summary
Modifier and TypeMethodDescriptionvoidfinal booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.booleanidentity()Returns the value of theidentityrecord component.keyCodec()Returns the value of thekeyCodecrecord component.booleanordered()Returns the value of theorderedrecord component.final StringtoString()Returns a string representation of this record class.Returns the value of thevalueCodecrecord component.Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface dev.latvian.mods.klib.core.KLibStreamCodec
linkedSetOf, listOf, nullable, optional, optional, setOfMethods inherited from interface net.minecraft.network.codec.StreamCodec
apply, cast, dispatch, map, mapStream
-
Constructor Details
-
UnboundMapStreamCodec
public UnboundMapStreamCodec(net.minecraft.network.codec.StreamCodec<? super B, K> keyCodec, net.minecraft.network.codec.StreamCodec<? super B, V> valueCodec, boolean ordered, boolean identity) Creates an instance of aUnboundMapStreamCodecrecord class.- Parameters:
keyCodec- the value for thekeyCodecrecord componentvalueCodec- the value for thevalueCodecrecord componentordered- the value for theorderedrecord componentidentity- the value for theidentityrecord component
-
-
Method Details
-
decode
-
encode
-
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. Reference components are compared withObjects::equals(Object,Object); primitive components are compared with '=='. -
keyCodec
Returns the value of thekeyCodecrecord component.- Returns:
- the value of the
keyCodecrecord component
-
valueCodec
Returns the value of thevalueCodecrecord component.- Returns:
- the value of the
valueCodecrecord component
-
ordered
public boolean ordered()Returns the value of theorderedrecord component.- Returns:
- the value of the
orderedrecord component
-
identity
public boolean identity()Returns the value of theidentityrecord component.- Returns:
- the value of the
identityrecord component
-