Record Class ChatMessage
java.lang.Object
java.lang.Record
com.botwithus.bot.api.model.ChatMessage
- Record Components:
index- the message index in the chat historymessageType- the message type (e.g., public chat, private message, game message)text- the message text contentplayerName- the name of the player who sent the message, ornullfor system messages
-
Constructor Summary
ConstructorsConstructorDescriptionChatMessage(int index, int messageType, String text, String playerName) Creates an instance of aChatMessagerecord class. -
Method Summary
Modifier and TypeMethodDescriptionfinal booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.intindex()Returns the value of theindexrecord component.intReturns the value of themessageTyperecord component.Returns the value of theplayerNamerecord component.text()Returns the value of thetextrecord component.final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
ChatMessage
Creates an instance of aChatMessagerecord class.- Parameters:
index- the value for theindexrecord componentmessageType- the value for themessageTyperecord componenttext- the value for thetextrecord componentplayerName- the value for theplayerNamerecord component
-
-
Method Details
-
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. Reference components are compared withObjects::equals(Object,Object); primitive components are compared with thecomparemethod from their corresponding wrapper classes. -
index
-
messageType
public int messageType()Returns the value of themessageTyperecord component.- Returns:
- the value of the
messageTyperecord component
-
text
-
playerName
Returns the value of theplayerNamerecord component.- Returns:
- the value of the
playerNamerecord component
-