You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@plc4x.apache.org by sr...@apache.org on 2018/08/16 12:29:03 UTC
[incubator-plc4x] 01/02: added toString()/equals()/hashCode() to
AdsSubscriptionHandle
This is an automated email from the ASF dual-hosted git repository.
sruehl pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-plc4x.git
commit ec3fb9fe3f18b6256418d00e2e4e5dac383ee093
Author: Sebastian Rühl <sr...@apache.org>
AuthorDate: Thu Aug 16 10:52:49 2018 +0200
added toString()/equals()/hashCode() to AdsSubscriptionHandle
---
.../java/ads/model/AdsSubscriptionHandle.java | 25 ++++++++++++++++++++++
1 file changed, 25 insertions(+)
diff --git a/plc4j/protocols/ads/src/main/java/org/apache/plc4x/java/ads/model/AdsSubscriptionHandle.java b/plc4j/protocols/ads/src/main/java/org/apache/plc4x/java/ads/model/AdsSubscriptionHandle.java
index 2850fa9..69742cb 100644
--- a/plc4j/protocols/ads/src/main/java/org/apache/plc4x/java/ads/model/AdsSubscriptionHandle.java
+++ b/plc4j/protocols/ads/src/main/java/org/apache/plc4x/java/ads/model/AdsSubscriptionHandle.java
@@ -21,6 +21,8 @@ package org.apache.plc4x.java.ads.model;
import org.apache.plc4x.java.ads.api.commands.types.NotificationHandle;
import org.apache.plc4x.java.api.model.SubscriptionHandle;
+import java.util.Objects;
+
public class AdsSubscriptionHandle implements SubscriptionHandle {
private NotificationHandle notificationHandle;
@@ -33,4 +35,27 @@ public class AdsSubscriptionHandle implements SubscriptionHandle {
return notificationHandle;
}
+ @Override
+ public boolean equals(Object o) {
+ if (this == o) {
+ return true;
+ }
+ if (!(o instanceof AdsSubscriptionHandle)) {
+ return false;
+ }
+ AdsSubscriptionHandle that = (AdsSubscriptionHandle) o;
+ return Objects.equals(notificationHandle, that.notificationHandle);
+ }
+
+ @Override
+ public int hashCode() {
+ return Objects.hash(notificationHandle);
+ }
+
+ @Override
+ public String toString() {
+ return "AdsSubscriptionHandle{" +
+ "notificationHandle=" + notificationHandle +
+ '}';
+ }
}