Class Notification

  • All Implemented Interfaces:
    java.io.Serializable

    @Deprecated
    public class Notification
    extends java.lang.Object
    implements java.io.Serializable
    Deprecated.
    in 7.8. See NotificationChannel.
    This class represents a notification that will be delivered to users. This is a general concept and it has no knowledge of the possible ways to be delivered (see NotificationChannel).

    When creating a new notification, it is strongly advised to give a default message that can be used by channels that don't want to specifically format messages for different notification types. You can use setDefaultMessage(String) for that purpose.

    Since:
    2.10
    See Also:
    Serialized Form
    • Constructor Summary

      Constructors 
      Constructor Description
      Notification​(java.lang.String type)
      Deprecated.
      Create a new Notification of the given type.
    • Method Summary

      All Methods Instance Methods Concrete Methods Deprecated Methods 
      Modifier and Type Method Description
      boolean equals​(java.lang.Object obj)
      Deprecated.
       
      java.lang.String getDefaultMessage()
      Deprecated.
      Returns the default message to display for this notification.
      java.lang.String getFieldValue​(java.lang.String field)
      Deprecated.
      Returns the value of a field.
      java.lang.String getType()
      Deprecated.
      Returns the type of the notification
      int hashCode()
      Deprecated.
       
      Notification setDefaultMessage​(java.lang.String value)
      Deprecated.
      When creating a new notification, it is strongly advised to give a default message that can be used by channels that don't want to specifically format messages for different notification types.
      Notification setFieldValue​(java.lang.String field, java.lang.String value)
      Deprecated.
      Adds a field (kind of property) to the notification
      java.lang.String toString()
      Deprecated.
       
      • Methods inherited from class java.lang.Object

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

      • Notification

        public Notification​(java.lang.String type)
        Deprecated.

        Create a new Notification of the given type. Example: type = "new-violations"

        Parameters:
        type - the type of notification
    • Method Detail

      • getType

        public java.lang.String getType()
        Deprecated.
        Returns the type of the notification
        Returns:
        the type
      • setDefaultMessage

        public Notification setDefaultMessage​(java.lang.String value)
        Deprecated.

        When creating a new notification, it is strongly advised to give a default message that can be used by channels that don't want to specifically format messages for different notification types.

        This method is equivalent to setting a value for the field DEFAULT_MESSAGE_KEY with setFieldValue(String, String).

        Since:
        3.5
      • getDefaultMessage

        public java.lang.String getDefaultMessage()
        Deprecated.
        Returns the default message to display for this notification.
      • setFieldValue

        public Notification setFieldValue​(java.lang.String field,
                                          @Nullable
                                          java.lang.String value)
        Deprecated.
        Adds a field (kind of property) to the notification
        Parameters:
        field - the name of the field (= the key)
        value - the value of the field
        Returns:
        the notification itself
      • getFieldValue

        @CheckForNull
        public java.lang.String getFieldValue​(java.lang.String field)
        Deprecated.
        Returns the value of a field.
        Parameters:
        field - the field
        Returns:
        the value of the field
      • equals

        public boolean equals​(java.lang.Object obj)
        Deprecated.
        Overrides:
        equals in class java.lang.Object
      • hashCode

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

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