lucene-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From a.@apache.org
Subject lucene-solr:jira/solr-10996: SOLR-10996 Add equals/hashCode to config beans.
Date Fri, 07 Jul 2017 13:46:17 GMT
Repository: lucene-solr
Updated Branches:
  refs/heads/jira/solr-10996 2d8b22225 -> f3e277d38


SOLR-10996 Add equals/hashCode to config beans.


Project: http://git-wip-us.apache.org/repos/asf/lucene-solr/repo
Commit: http://git-wip-us.apache.org/repos/asf/lucene-solr/commit/f3e277d3
Tree: http://git-wip-us.apache.org/repos/asf/lucene-solr/tree/f3e277d3
Diff: http://git-wip-us.apache.org/repos/asf/lucene-solr/diff/f3e277d3

Branch: refs/heads/jira/solr-10996
Commit: f3e277d382f41236c6f4089e21ebb183df908dc6
Parents: 2d8b222
Author: Andrzej Bialecki <ab@apache.org>
Authored: Fri Jul 7 15:45:45 2017 +0200
Committer: Andrzej Bialecki <ab@apache.org>
Committed: Fri Jul 7 15:45:45 2017 +0200

----------------------------------------------------------------------
 .../cloud/autoscaling/AutoScalingConfig.java    | 48 ++++++++++++++++++++
 1 file changed, 48 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/f3e277d3/solr/core/src/java/org/apache/solr/cloud/autoscaling/AutoScalingConfig.java
----------------------------------------------------------------------
diff --git a/solr/core/src/java/org/apache/solr/cloud/autoscaling/AutoScalingConfig.java b/solr/core/src/java/org/apache/solr/cloud/autoscaling/AutoScalingConfig.java
index e3176ad..407f6a2 100644
--- a/solr/core/src/java/org/apache/solr/cloud/autoscaling/AutoScalingConfig.java
+++ b/solr/core/src/java/org/apache/solr/cloud/autoscaling/AutoScalingConfig.java
@@ -74,6 +74,34 @@ public class AutoScalingConfig {
       beforeActions = new HashSet<>(getList(AutoScalingParams.BEFORE_ACTION, properties));
       afterActions = new HashSet<>(getList(AutoScalingParams.AFTER_ACTION, properties));
     }
+
+    @Override
+    public boolean equals(Object o) {
+      if (this == o) return true;
+      if (o == null || getClass() != o.getClass()) return false;
+
+      TriggerListenerConfig that = (TriggerListenerConfig) o;
+
+      if (name != null ? !name.equals(that.name) : that.name != null) return false;
+      if (trigger != null ? !trigger.equals(that.trigger) : that.trigger != null) return
false;
+      if (!stages.equals(that.stages)) return false;
+      if (listenerClass != null ? !listenerClass.equals(that.listenerClass) : that.listenerClass
!= null) return false;
+      if (!beforeActions.equals(that.beforeActions)) return false;
+      if (!afterActions.equals(that.afterActions)) return false;
+      return properties.equals(that.properties);
+    }
+
+    @Override
+    public int hashCode() {
+      int result = name != null ? name.hashCode() : 0;
+      result = 31 * result + (trigger != null ? trigger.hashCode() : 0);
+      result = 31 * result + stages.hashCode();
+      result = 31 * result + (listenerClass != null ? listenerClass.hashCode() : 0);
+      result = 31 * result + beforeActions.hashCode();
+      result = 31 * result + afterActions.hashCode();
+      result = 31 * result + properties.hashCode();
+      return result;
+    }
   }
 
   /**
@@ -90,6 +118,26 @@ public class AutoScalingConfig {
       this.eventType = AutoScaling.EventType.valueOf(event.toUpperCase(Locale.ROOT));
       this.properties.putAll(properties);
     }
+
+    @Override
+    public boolean equals(Object o) {
+      if (this == o) return true;
+      if (o == null || getClass() != o.getClass()) return false;
+
+      TriggerConfig that = (TriggerConfig) o;
+
+      if (name != null ? !name.equals(that.name) : that.name != null) return false;
+      if (eventType != that.eventType) return false;
+      return properties.equals(that.properties);
+    }
+
+    @Override
+    public int hashCode() {
+      int result = name != null ? name.hashCode() : 0;
+      result = 31 * result + eventType.hashCode();
+      result = 31 * result + properties.hashCode();
+      return result;
+    }
   }
 
   public AutoScalingConfig(byte[] utf8) {


Mime
View raw message