diff options
Diffstat (limited to 'sonar-plugin-api/src')
-rw-r--r-- | sonar-plugin-api/src/main/java/org/sonar/api/notifications/Notification.java | 10 | ||||
-rw-r--r-- | sonar-plugin-api/src/main/java/org/sonar/api/notifications/NotificationDispatcher.java | 9 |
2 files changed, 14 insertions, 5 deletions
diff --git a/sonar-plugin-api/src/main/java/org/sonar/api/notifications/Notification.java b/sonar-plugin-api/src/main/java/org/sonar/api/notifications/Notification.java index aa04f52069a..0666e7260f1 100644 --- a/sonar-plugin-api/src/main/java/org/sonar/api/notifications/Notification.java +++ b/sonar-plugin-api/src/main/java/org/sonar/api/notifications/Notification.java @@ -20,11 +20,10 @@ package org.sonar.api.notifications; import com.google.common.collect.Maps; -import org.apache.commons.lang.builder.ReflectionToStringBuilder; -import org.apache.commons.lang.builder.ToStringStyle; import javax.annotation.CheckForNull; import javax.annotation.Nullable; + import java.io.Serializable; import java.util.Map; @@ -140,7 +139,10 @@ public class Notification implements Serializable { @Override public String toString() { - return ReflectionToStringBuilder.toString(this, ToStringStyle.SHORT_PREFIX_STYLE); + StringBuilder sb = new StringBuilder("Notification{"); + sb.append("type='").append(type).append('\''); + sb.append(", fields=").append(fields); + sb.append('}'); + return sb.toString(); } - } diff --git a/sonar-plugin-api/src/main/java/org/sonar/api/notifications/NotificationDispatcher.java b/sonar-plugin-api/src/main/java/org/sonar/api/notifications/NotificationDispatcher.java index b4bff26e29f..5ad0be8ed66 100644 --- a/sonar-plugin-api/src/main/java/org/sonar/api/notifications/NotificationDispatcher.java +++ b/sonar-plugin-api/src/main/java/org/sonar/api/notifications/NotificationDispatcher.java @@ -39,7 +39,7 @@ import org.sonar.api.ServerExtension; */ public abstract class NotificationDispatcher implements ServerExtension { - private String notificationType; + private final String notificationType; /** * Additional information related to the notification, which will be used @@ -92,6 +92,13 @@ public abstract class NotificationDispatcher implements ServerExtension { } /** + * @since 5.1 + */ + public String getType() { + return notificationType; + } + + /** * <p> * Performs the dispatch. * </p> |