java.lang.Object
java.lang.Record
nl.andrewl.concord_core.msg.types.chat.Chat
- All Implemented Interfaces:
Message
public record Chat(UUID id, UUID senderId, String senderNickname, long timestamp, String message)
extends Record
implements Message
This message contains information about a chat message that a user sent.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final UUID
The field for theid
record component.private final String
The field for themessage
record component.private final UUID
The field for thesenderId
record component.private final String
The field for thesenderNickname
record component.private final long
The field for thetimestamp
record component. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionboolean
Indicates whether some other object is "equal to" this one.final int
hashCode()
Returns a hash code value for this object.id()
Returns the value of theid
record component.message()
Returns the value of themessage
record component.senderId()
Returns the value of thesenderId
record component.Returns the value of thesenderNickname
record component.long
Returns the value of thetimestamp
record component.toString()
Returns a string representation of this record class.Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface nl.andrewl.concord_core.msg.Message
byteSize, getTypeSerializer
-
Field Details
-
id
The field for theid
record component. -
senderId
The field for thesenderId
record component. -
senderNickname
The field for thesenderNickname
record component. -
timestamp
private final long timestampThe field for thetimestamp
record component. -
message
The field for themessage
record component.
-
-
Constructor Details
-
Chat
-
Chat
-
Chat
-
Chat
Creates an instance of aChat
record class.- Parameters:
id
- the value for theid
record componentsenderId
- the value for thesenderId
record componentsenderNickname
- the value for thesenderNickname
record componenttimestamp
- the value for thetimestamp
record componentmessage
- the value for themessage
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. -
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 '=='. -
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. -
id
Returns the value of theid
record component.- Returns:
- the value of the
id
record component
-
senderId
Returns the value of thesenderId
record component.- Returns:
- the value of the
senderId
record component
-
senderNickname
Returns the value of thesenderNickname
record component.- Returns:
- the value of the
senderNickname
record component
-
timestamp
public long timestamp()Returns the value of thetimestamp
record component.- Returns:
- the value of the
timestamp
record component
-
message
Returns the value of themessage
record component.- Returns:
- the value of the
message
record component
-