Class ChatMessage


  • public class ChatMessage
    extends java.lang.Object
    An event where a new chat message is received.

    See ChatMessageType for different message types that can be received.

    Note: This event will not trigger for NPC dialogues.

    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      protected boolean canEqual​(java.lang.Object other)  
      boolean equals​(java.lang.Object o)  
      java.lang.String getMessage()
      The contents of the message.
      MessageNode getMessageNode()
      The underlying MessageNode for the message.
      java.lang.String getName()
      The name of the player that sent the message.
      java.lang.String getSender()
      The sender of the message.
      int getTimestamp()
      Timestamp of the message.
      ChatMessageType getType()
      The type of message received.
      int hashCode()  
      void setMessage​(java.lang.String message)
      The contents of the message.
      void setMessageNode​(MessageNode messageNode)
      The underlying MessageNode for the message.
      void setName​(java.lang.String name)
      The name of the player that sent the message.
      void setSender​(java.lang.String sender)
      The sender of the message.
      void setTimestamp​(int timestamp)
      Timestamp of the message.
      void setType​(ChatMessageType type)
      The type of message received.
      java.lang.String toString()  
      • Methods inherited from class java.lang.Object

        clone, finalize, getClass, notify, notifyAll, wait, wait, wait
    • Constructor Detail

      • ChatMessage

        public ChatMessage​(MessageNode messageNode,
                           ChatMessageType type,
                           java.lang.String name,
                           java.lang.String message,
                           java.lang.String sender,
                           int timestamp)
      • ChatMessage

        public ChatMessage()
    • Method Detail

      • getMessageNode

        public MessageNode getMessageNode()
        The underlying MessageNode for the message.
      • getName

        public java.lang.String getName()
        The name of the player that sent the message.
      • getMessage

        public java.lang.String getMessage()
        The contents of the message.
      • getSender

        public java.lang.String getSender()
        The sender of the message.

        This field is only used for friends chat messages and refers to the current name of the friends chat the client is in.

      • getTimestamp

        public int getTimestamp()
        Timestamp of the message.
      • setMessageNode

        public void setMessageNode​(MessageNode messageNode)
        The underlying MessageNode for the message.
      • setType

        public void setType​(ChatMessageType type)
        The type of message received.
      • setName

        public void setName​(java.lang.String name)
        The name of the player that sent the message.
      • setMessage

        public void setMessage​(java.lang.String message)
        The contents of the message.
      • setSender

        public void setSender​(java.lang.String sender)
        The sender of the message.

        This field is only used for friends chat messages and refers to the current name of the friends chat the client is in.

      • setTimestamp

        public void setTimestamp​(int timestamp)
        Timestamp of the message.
      • equals

        public boolean equals​(java.lang.Object o)
        Overrides:
        equals in class java.lang.Object
      • canEqual

        protected boolean canEqual​(java.lang.Object other)
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class java.lang.Object
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object