Record Class OptionalDefaultStreamCodec<B,V>
java.lang.Object
java.lang.Record
dev.latvian.mods.klib.codec.OptionalDefaultStreamCodec<B,V>
- All Implemented Interfaces:
KLibStreamCodec<B,V>, net.minecraft.network.codec.StreamCodec<B, V>, net.minecraft.network.codec.StreamDecoder<B, V>, net.minecraft.network.codec.StreamEncoder<B, 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
ConstructorsConstructorDescriptionOptionalDefaultStreamCodec(net.minecraft.network.codec.StreamCodec<B, V> parent) OptionalDefaultStreamCodec(net.minecraft.network.codec.StreamCodec<B, V> parent, V defaultValue) Creates an instance of aOptionalDefaultStreamCodecrecord class. -
Method Summary
Modifier and TypeMethodDescriptionReturns the value of thedefaultValuerecord component.voidfinal booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.parent()Returns the value of theparentrecord component.final StringtoString()Returns a string representation of this record class.Methods inherited from interface net.minecraft.network.codec.StreamCodec
apply, cast, dispatch, map, mapStream
-
Constructor Details
-
OptionalDefaultStreamCodec
-
OptionalDefaultStreamCodec
public OptionalDefaultStreamCodec(net.minecraft.network.codec.StreamCodec<B, V> parent, @Nullable V defaultValue) Creates an instance of aOptionalDefaultStreamCodecrecord class.- Parameters:
parent- the value for theparentrecord componentdefaultValue- the value for thedefaultValuerecord component
-
-
Method Details
-
decode
-
encode
-
toString
-
hashCode
-
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). -
parent
-
defaultValue
Returns the value of thedefaultValuerecord component.- Returns:
- the value of the
defaultValuerecord component
-