|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.sonar.api.notifications.Notification
public class Notification
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) or of the users who should
receive it (see NotificationDispatcher).
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.
| Constructor Summary | |
|---|---|
Notification(String type)
Create a new Notification of the given type. |
|
| Method Summary | |
|---|---|
boolean |
equals(Object obj)
|
String |
getDefaultMessage()
Returns the default message to display for this notification. |
String |
getFieldValue(String field)
Returns the value of a field. |
String |
getType()
Returns the type of the notification |
int |
hashCode()
|
Notification |
setDefaultMessage(String value)
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(String field,
String value)
Adds a field (kind of property) to the notification |
String |
toString()
|
| Methods inherited from class java.lang.Object |
|---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public Notification(String type)
Create a new Notification of the given type.
type - the type of notification| Method Detail |
|---|
public String getType()
public Notification setDefaultMessage(String value)
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).
public String getDefaultMessage()
public Notification setFieldValue(String field,
@Nullable
String value)
field - the name of the field (= the key)value - the value of the field
@CheckForNull public String getFieldValue(String field)
field - the field
public boolean equals(Object obj)
equals in class Objectpublic int hashCode()
hashCode in class Objectpublic String toString()
toString in class Object
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||