Package org.opentcs.data.notification
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 classUserNotification.LevelDefines 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 booleanequals(java.lang.Object o)UserNotification.LevelgetLevel()Returns this message's type.java.lang.StringgetSource()Returns this notification's (optional) source.java.lang.StringgetText()Returns this message's text.java.time.InstantgetTimestamp()Returns this message's creation timestamp.inthashCode()java.lang.StringtoString()
-
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
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
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:
hashCodein classjava.lang.Object
-
equals
public boolean equals(java.lang.Object o)- Overrides:
equalsin classjava.lang.Object
-
toString
public java.lang.String toString()- Overrides:
toStringin classjava.lang.Object
-