Record Class PacketPayload.GamePacket
java.lang.Object
java.lang.Record
com.quietterminal.neon.core.PacketPayload.GamePacket
- All Implemented Interfaces:
PacketPayload
- Enclosing interface:
PacketPayload
public static record PacketPayload.GamePacket(byte[] payload)
extends Record
implements PacketPayload
-
Nested Class Summary
Nested classes/interfaces inherited from interface PacketPayload
PacketPayload.Ack, PacketPayload.ConnectAccept, PacketPayload.ConnectDeny, PacketPayload.ConnectRequest, PacketPayload.DisconnectNotice, PacketPayload.GamePacket, PacketPayload.HostRegister, PacketPayload.PacketTypeEntry, PacketPayload.PacketTypeRegistry, PacketPayload.Ping, PacketPayload.Pong, PacketPayload.ReconnectRequest, PacketPayload.SessionConfig -
Field Summary
Fields inherited from interface PacketPayload
MAX_DESCRIPTION_LENGTH, MAX_NAME_LENGTH, MAX_PACKET_COUNT -
Constructor Summary
ConstructorsConstructorDescriptionGamePacket(byte[] payload) Creates an instance of aGamePacketrecord class. -
Method Summary
Modifier and TypeMethodDescriptionbooleanIndicates whether some other object is "equal to" this one.static PacketPayload.GamePacketfromBytes(byte[] data) inthashCode()Returns a hash code value for this object.byte[]payload()Returns the value of thepayloadrecord component.byte[]toBytes()final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
GamePacket
public GamePacket(byte[] payload) Creates an instance of aGamePacketrecord class.- Parameters:
payload- the value for thepayloadrecord component
-
-
Method Details
-
toBytes
public byte[] toBytes()- Specified by:
toBytesin interfacePacketPayload
-
fromBytes
-
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). -
hashCode
-
toString
-
payload
public byte[] payload()Returns the value of thepayloadrecord component.- Returns:
- the value of the
payloadrecord component
-