Record Class ByteBufMessageBuffer
java.lang.Object
java.lang.Record
org.geysermc.geyser.network.message.ByteBufMessageBuffer
- All Implemented Interfaces:
org.geysermc.geyser.api.network.message.MessageBuffer,org.geysermc.geyser.api.network.message.MessageBuffer.Wrapped<io.netty.buffer.ByteBuf>
public record ByteBufMessageBuffer(org.geysermc.geyser.api.network.message.MessageCodec<ByteBufMessageBuffer> codec, io.netty.buffer.ByteBuf buffer)
extends Record
implements org.geysermc.geyser.api.network.message.MessageBuffer.Wrapped<io.netty.buffer.ByteBuf>
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.geysermc.geyser.api.network.message.MessageBuffer
org.geysermc.geyser.api.network.message.MessageBuffer.Wrapped<T> -
Constructor Summary
ConstructorsConstructorDescriptionByteBufMessageBuffer(org.geysermc.geyser.api.network.message.MessageCodec<ByteBufMessageBuffer> codec) ByteBufMessageBuffer(org.geysermc.geyser.api.network.message.MessageCodec<ByteBufMessageBuffer> codec, io.netty.buffer.ByteBuf buffer) Creates an instance of aByteBufMessageBufferrecord class. -
Method Summary
Modifier and TypeMethodDescriptionio.netty.buffer.ByteBufbuffer()Returns the value of thebufferrecord component.org.geysermc.geyser.api.network.message.MessageCodec<ByteBufMessageBuffer> codec()Returns the value of thecodecrecord component.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.intlength()<T> @NonNull Tread(@NonNull org.geysermc.geyser.api.network.message.DataType<T> type) byte @NonNull []final StringtoString()Returns a string representation of this record class.<T> voidwrite(@NonNull org.geysermc.geyser.api.network.message.DataType<T> type, @NonNull T value)
-
Constructor Details
-
ByteBufMessageBuffer
public ByteBufMessageBuffer(org.geysermc.geyser.api.network.message.MessageCodec<ByteBufMessageBuffer> codec) -
ByteBufMessageBuffer
public ByteBufMessageBuffer(org.geysermc.geyser.api.network.message.MessageCodec<ByteBufMessageBuffer> codec, io.netty.buffer.ByteBuf buffer) Creates an instance of aByteBufMessageBufferrecord class.- Parameters:
codec- the value for thecodecrecord componentbuffer- the value for thebufferrecord component
-
-
Method Details
-
read
public <T> @NonNull T read(@NonNull org.geysermc.geyser.api.network.message.DataType<T> type) - Specified by:
readin interfaceorg.geysermc.geyser.api.network.message.MessageBuffer
-
write
public <T> void write(@NonNull org.geysermc.geyser.api.network.message.DataType<T> type, @NonNull T value) - Specified by:
writein interfaceorg.geysermc.geyser.api.network.message.MessageBuffer
-
serialize
public byte @NonNull [] serialize()- Specified by:
serializein interfaceorg.geysermc.geyser.api.network.message.MessageBuffer
-
length
public int length()- Specified by:
lengthin interfaceorg.geysermc.geyser.api.network.message.MessageBuffer
-
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). -
codec
Returns the value of thecodecrecord component.- Returns:
- the value of the
codecrecord component
-
buffer
public io.netty.buffer.ByteBuf buffer()Returns the value of thebufferrecord component.- Specified by:
bufferin interfaceorg.geysermc.geyser.api.network.message.MessageBuffer.Wrapped<io.netty.buffer.ByteBuf>- Returns:
- the value of the
bufferrecord component
-