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
ConstructorDescriptionBufferedPacket
(@NotNull NetworkBuffer buffer, long index, long length) Creates an instance of aBufferedPacket
record class. -
Method Summary
Modifier and TypeMethodDescription@NotNull NetworkBuffer
buffer()
Returns the value of thebuffer
record component.final boolean
Indicates whether some other object is "equal to" this one.final int
hashCode()
Returns a hash code value for this object.long
index()
Returns the value of theindex
record component.long
length()
Returns the value of thelength
record component.final String
toString()
Returns a string representation of this record class.
-
Constructor Details
-
BufferedPacket
Creates an instance of aBufferedPacket
record class.- Parameters:
buffer
- the value for thebuffer
record componentindex
- the value for theindex
record componentlength
- the value for thelength
record 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 thebuffer
record component.- Returns:
- the value of the
buffer
record component
-
index
public long index()Returns the value of theindex
record component.- Returns:
- the value of the
index
record component
-
length
public long length()Returns the value of thelength
record component.- Returns:
- the value of the
length
record component
-