Record Class DataTypeBuilderStreamCodec<C>
java.lang.Object
java.lang.Record
dev.latvian.mods.klib.data.DataTypeBuilderStreamCodec<C>
- All Implemented Interfaces:
KLibStreamCodec<io.netty.buffer.ByteBuf, C>, net.minecraft.network.codec.StreamCodec<io.netty.buffer.ByteBuf, C>, net.minecraft.network.codec.StreamDecoder<io.netty.buffer.ByteBuf, C>, net.minecraft.network.codec.StreamEncoder<io.netty.buffer.ByteBuf, C>
-
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
ConstructorsConstructorDescriptionDataTypeBuilderStreamCodec(List<DataTypeField<C, ?>> fields, Function<Object[], C> constructor) DataTypeBuilderStreamCodec(List<DataTypeField<C, ?>> fields, Function<Object[], C> constructor, boolean canBeOptional) Creates an instance of aDataTypeBuilderStreamCodecrecord class. -
Method Summary
Modifier and TypeMethodDescriptionbooleanReturns the value of thecanBeOptionalrecord component.Returns the value of theconstructorrecord component.decode(io.netty.buffer.ByteBuf buf) voidfinal booleanIndicates whether some other object is "equal to" this one.List<DataTypeField<C, ?>> fields()Returns the value of thefieldsrecord component.final inthashCode()Returns a hash code value for this object.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
-
DataTypeBuilderStreamCodec
-
DataTypeBuilderStreamCodec
public DataTypeBuilderStreamCodec(List<DataTypeField<C, ?>> fields, Function<Object[], C> constructor, boolean canBeOptional) Creates an instance of aDataTypeBuilderStreamCodecrecord class.- Parameters:
fields- the value for thefieldsrecord componentconstructor- the value for theconstructorrecord componentcanBeOptional- the value for thecanBeOptionalrecord 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. Reference components are compared withObjects::equals(Object,Object); primitive components are compared with thecomparemethod from their corresponding wrapper classes. -
fields
Returns the value of thefieldsrecord component.- Returns:
- the value of the
fieldsrecord component
-
constructor
-
canBeOptional
public boolean canBeOptional()Returns the value of thecanBeOptionalrecord component.- Returns:
- the value of the
canBeOptionalrecord component
-