Class MyMessage


  • public class MyMessage
    extends Object
    A Java POJO to represent the message element in a chat.
    Author:
    mayankkakad
    • Field Detail

      • receiver

        public String receiver
        A string representing the receiver
      • sender

        public String sender
        A string representing the sender
      • text

        public String text
        A string representing the text of the chat bubble
      • timestamp

        public String timestamp
        A string representing the time at which the message was sent. Refer EnvironmentConfigurer for the format
    • Constructor Detail

      • MyMessage

        public MyMessage​(String text,
                         String timestamp,
                         String sender,
                         String receiver)
        A parametrized constructor, that takes in the text content of the message, the time at which it was sent, the sender and recevier
        Parameters:
        text - The text of the message
        timestamp - The time at which the message was sent
        sender - The sender
        receiver - The receiver
    • Method Detail

      • toString

        public String toString()
        Returns a string representation of the object
        Overrides:
        toString in class Object