Record Class BufferedPacket
java.lang.Object
java.lang.Record
net.minestom.server.network.packet.server.BufferedPacket
- All Implemented Interfaces:
SendablePacket
@Internal
public record BufferedPacket(@NotNull NetworkBuffer buffer, long index, long length)
extends Record
implements SendablePacket
Represents a buffer to directly write to the network.
May contain multiple packets.
-
Constructor Summary
ConstructorsConstructorDescriptionBufferedPacket(@NotNull NetworkBuffer buffer, long index, long length) Creates an instance of aBufferedPacketrecord class. -
Method Summary
Modifier and TypeMethodDescription@NotNull NetworkBufferbuffer()Returns the value of thebufferrecord component.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.longindex()Returns the value of theindexrecord component.longlength()Returns the value of thelengthrecord component.final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
BufferedPacket
Creates an instance of aBufferedPacketrecord class.- Parameters:
buffer- the value for thebufferrecord componentindex- the value for theindexrecord componentlength- the value for thelengthrecord component
-
-
Method Details
-
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 '=='. -
buffer
Returns the value of thebufferrecord component.- Returns:
- the value of the
bufferrecord component
-
index
public long index()Returns the value of theindexrecord component.- Returns:
- the value of the
indexrecord component
-
length
public long length()Returns the value of thelengthrecord component.- Returns:
- the value of the
lengthrecord component
-