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.Serializable
Deprecated.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 newNotification
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 notificationint
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 notificationjava.lang.String
toString()
Deprecated.
-
-
-
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
withsetFieldValue(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 classjava.lang.Object
-
hashCode
public int hashCode()
Deprecated.- Overrides:
hashCode
in classjava.lang.Object
-
toString
public java.lang.String toString()
Deprecated.- Overrides:
toString
in classjava.lang.Object
-
-