Record Class NeonPacket
java.lang.Object
java.lang.Record
com.quietterminal.neon.core.NeonPacket
-
Constructor Summary
ConstructorsConstructorDescriptionNeonPacket(PacketHeader header, PacketPayload payload) Creates an instance of aNeonPacketrecord class. -
Method Summary
Modifier and TypeMethodDescriptionstatic NeonPacketcreate(PacketType type, short sequence, byte clientId, byte destId, PacketPayload payload) final booleanIndicates whether some other object is "equal to" this one.static NeonPacketfromBytes(byte[] data) final inthashCode()Returns a hash code value for this object.header()Returns the value of theheaderrecord component.payload()Returns the value of thepayloadrecord component.byte[]toBytes()final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
NeonPacket
Creates an instance of aNeonPacketrecord class.- Parameters:
header- the value for theheaderrecord componentpayload- the value for thepayloadrecord component
-
-
Method Details
-
toBytes
public byte[] toBytes() -
fromBytes
-
create
public static NeonPacket create(PacketType type, short sequence, byte clientId, byte destId, PacketPayload payload) -
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. All components in this record class are compared withObjects::equals(Object,Object). -
header
Returns the value of theheaderrecord component.- Returns:
- the value of the
headerrecord component
-
payload
Returns the value of thepayloadrecord component.- Returns:
- the value of the
payloadrecord component
-