java.lang.Object
io.github.astrapi69.design.pattern.observer.chat.StringMessage
All Implemented Interfaces:
Message<String>, Serializable

public class StringMessage extends Object implements Message<String>
The class StringMessage represents a message that contains a string value It implements the Message interface and provides methods to get and set the string value
See Also:
  • Constructor Details

    • StringMessage

      public StringMessage()
      Instantiates a new StringMessage with no initial value
    • StringMessage

      public StringMessage(String value)
      Instantiates a new StringMessage with the given value
      Parameters:
      value - the value of the message
  • Method Details

    • getValue

      public String getValue()
      Gets the value of the message
      Specified by:
      getValue in interface Message<String>
      Returns:
      the value of the message
    • setValue

      public StringMessage setValue(String value)
      Sets the value of the message
      Specified by:
      setValue in interface Message<String>
      Parameters:
      value - the value to set
      Returns:
      the updated message
    • toString

      public String toString()
      Overrides:
      toString in class Object