Package org.sonar.api.notifications
Class Notification
- java.lang.Object
-
- org.sonar.api.notifications.Notification
-
- All Implemented Interfaces:
java.io.Serializable
@Deprecated public class Notification extends java.lang.Object implements java.io.SerializableDeprecated.in 7.8. SeeNotificationChannel.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 (seeNotificationChannel).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 newNotificationof the given type.
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description booleanequals(java.lang.Object obj)Deprecated.java.lang.StringgetDefaultMessage()Deprecated.Returns the default message to display for this notification.java.lang.StringgetFieldValue(java.lang.String field)Deprecated.Returns the value of a field.java.lang.StringgetType()Deprecated.Returns the type of the notificationinthashCode()Deprecated.NotificationsetDefaultMessage(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.NotificationsetFieldValue(java.lang.String field, java.lang.String value)Deprecated.Adds a field (kind of property) to the notificationjava.lang.StringtoString()Deprecated.
-
-
-
Constructor Detail
-
Notification
public Notification(java.lang.String type)
Deprecated.Create a new
Notificationof 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_KEYwithsetFieldValue(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:
equalsin classjava.lang.Object
-
hashCode
public int hashCode()
Deprecated.- Overrides:
hashCodein classjava.lang.Object
-
toString
public java.lang.String toString()
Deprecated.- Overrides:
toStringin classjava.lang.Object
-
-