You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@streampipes.apache.org by bo...@apache.org on 2023/10/20 14:15:25 UTC

[streampipes] 05/09: refactor: implement string representation of Notification

This is an automated email from the ASF dual-hosted git repository.

bossenti pushed a commit to branch 2045-implement-migration-for-adapter-and-pipeline-element-configurations
in repository https://gitbox.apache.org/repos/asf/streampipes.git

commit 646e792d50b3022748e99be738c390270b87c345
Author: bossenti <bo...@posteo.de>
AuthorDate: Fri Oct 20 10:54:58 2023 +0200

    refactor: implement string representation of Notification
---
 .../java/org/apache/streampipes/model/Notification.java   | 15 +++++++++++++--
 1 file changed, 13 insertions(+), 2 deletions(-)

diff --git a/streampipes-model/src/main/java/org/apache/streampipes/model/Notification.java b/streampipes-model/src/main/java/org/apache/streampipes/model/Notification.java
index 3b9f47f84..48d8c7549 100644
--- a/streampipes-model/src/main/java/org/apache/streampipes/model/Notification.java
+++ b/streampipes-model/src/main/java/org/apache/streampipes/model/Notification.java
@@ -26,8 +26,10 @@ import java.util.Date;
 
 public class Notification {
 
-  private @JsonProperty("_id") @SerializedName("_id") String id;
-  private @JsonProperty("_rev") @SerializedName("_rev") String rev;
+  private @JsonProperty("_id")
+  @SerializedName("_id") String id;
+  private @JsonProperty("_rev")
+  @SerializedName("_rev") String rev;
 
   private String title;
   private Date createdAt;
@@ -120,4 +122,13 @@ public class Notification {
   public void setCreatedAtTimestamp(long createdAtTimestamp) {
     this.createdAtTimestamp = createdAtTimestamp;
   }
+
+  public String toString() {
+    return String.format("Notification '%s' with target '%s' created at %s: '%s'",
+            title,
+            targetedAt,
+            createdAt,
+            message
+    );
+  }
 }