Class UserNotification

java.lang.Object
org.opentcs.data.notification.UserNotification
All Implemented Interfaces:
java.io.Serializable

public class UserNotification
extends java.lang.Object
implements java.io.Serializable
A notification to be read by a user.
See Also:
Serialized Form
  • Nested Class Summary

    Nested Classes 
    Modifier and Type Class Description
    static class  UserNotification.Level
    Defines the possible message types.
  • Constructor Summary

    Constructors 
    Constructor Description
    UserNotification​(java.lang.String source, java.lang.String text, UserNotification.Level level)
    Creates a new Message.
    UserNotification​(java.lang.String text, UserNotification.Level level)
    Creates a new Message.
  • Method Summary

    Modifier and Type Method Description
    boolean equals​(java.lang.Object o)  
    UserNotification.Level getLevel()
    Returns this message's type.
    java.lang.String getSource()
    Returns this notification's (optional) source.
    java.lang.String getText()
    Returns this message's text.
    java.time.Instant getTimestamp()
    Returns this message's creation timestamp.
    int hashCode()  
    java.lang.String toString()  

    Methods inherited from class java.lang.Object

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

    • UserNotification

      public UserNotification​(@Nullable java.lang.String source, java.lang.String text, UserNotification.Level level)
      Creates a new Message.
      Parameters:
      source - An identifier of the notification's source.
      text - The actual message text.
      level - The new message's level.
    • UserNotification

      public UserNotification​(java.lang.String text, UserNotification.Level level)
      Creates a new Message.
      Parameters:
      text - The actual message text.
      level - The new message's level.
  • Method Details

    • getSource

      @Nullable public java.lang.String getSource()
      Returns this notification's (optional) source.
      Returns:
      This notification's (optional) source.
    • getText

      public java.lang.String getText()
      Returns this message's text.
      Returns:
      This message's text.
    • getLevel

      public UserNotification.Level getLevel()
      Returns this message's type.
      Returns:
      This message's type.
    • getTimestamp

      public java.time.Instant getTimestamp()
      Returns this message's creation timestamp.
      Returns:
      This message's creation timestamp.
    • hashCode

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

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

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