diff options
author | Arne H Juul <arnej@yahoo-inc.com> | 2017-04-25 14:42:45 +0200 |
---|---|---|
committer | Arne H Juul <arnej@yahoo-inc.com> | 2017-04-25 14:42:45 +0200 |
commit | 5bd8497d2d616ec337250f596767b6809731b3f7 (patch) | |
tree | acc09daae375008be4e4315f0ba809b3b5a074a5 /config-model | |
parent | 40968fe3fb8eaf9983db3aa8a954060238560b04 (diff) |
implement hashCode()
Diffstat (limited to 'config-model')
4 files changed, 19 insertions, 0 deletions
diff --git a/config-model/src/main/java/com/yahoo/searchdefinition/derived/VsmFields.java b/config-model/src/main/java/com/yahoo/searchdefinition/derived/VsmFields.java index 733528a1d26..ab7cf7387a7 100644 --- a/config-model/src/main/java/com/yahoo/searchdefinition/derived/VsmFields.java +++ b/config-model/src/main/java/com/yahoo/searchdefinition/derived/VsmFields.java @@ -132,6 +132,7 @@ public class VsmFields extends Derived implements VsmfieldsConfig.Producer { this.searchMethod=searchMethod; } + @Override public int hashCode() { return name.hashCode(); } @@ -141,6 +142,7 @@ public class VsmFields extends Derived implements VsmfieldsConfig.Producer { public String getSearchMethod() { return searchMethod; } + @Override public boolean equals(Object other) { if ( ! (other instanceof Type)) return false; return this.name.equals(((Type)other).name); @@ -225,6 +227,7 @@ public class VsmFields extends Derived implements VsmfieldsConfig.Producer { return fB; } + @Override public boolean equals(Object o) { if (o.getClass().equals(getClass())) { StreamingField sf = (StreamingField)o; @@ -235,6 +238,10 @@ public class VsmFields extends Derived implements VsmfieldsConfig.Producer { return false; } + @Override public int hashCode() { + return java.util.Objects.hash(name, matching, type); + } + } private static class StreamingDocumentType { diff --git a/config-model/src/main/java/com/yahoo/searchdefinition/document/Matching.java b/config-model/src/main/java/com/yahoo/searchdefinition/document/Matching.java index 3c90bcef513..f4efadbd049 100644 --- a/config-model/src/main/java/com/yahoo/searchdefinition/document/Matching.java +++ b/config-model/src/main/java/com/yahoo/searchdefinition/document/Matching.java @@ -134,6 +134,7 @@ public class Matching implements Cloneable, Serializable { } } + @Override public boolean equals(Object o) { if (! (o instanceof Matching)) return false; @@ -147,5 +148,8 @@ public class Matching implements Cloneable, Serializable { return true; } + @Override public int hashCode() { + return java.util.Objects.hash(type, algorithm, exactMatchTerminator, gramSize); + } } diff --git a/config-model/src/main/java/com/yahoo/searchdefinition/document/Ranking.java b/config-model/src/main/java/com/yahoo/searchdefinition/document/Ranking.java index 9e0bda7fd5a..442673e3a46 100644 --- a/config-model/src/main/java/com/yahoo/searchdefinition/document/Ranking.java +++ b/config-model/src/main/java/com/yahoo/searchdefinition/document/Ranking.java @@ -52,6 +52,10 @@ public class Ranking implements Cloneable, Serializable { return true; } + public @Override int hashCode() { + return java.util.Objects.hash(filter, literal, normal); + } + public @Override String toString() { return "rank settings [filter: " + filter + ", literal: " + literal + ", normal: "+normal+"]"; } diff --git a/config-model/src/main/java/com/yahoo/vespa/model/content/StorageGroup.java b/config-model/src/main/java/com/yahoo/vespa/model/content/StorageGroup.java index 8e065b7d73d..822f4a9c9c7 100644 --- a/config-model/src/main/java/com/yahoo/vespa/model/content/StorageGroup.java +++ b/config-model/src/main/java/com/yahoo/vespa/model/content/StorageGroup.java @@ -178,6 +178,10 @@ public class StorageGroup { return false; } + @Override public int hashCode() { + return java.util.Objects.hash(index, name, partitions); + } + public static Map<HostResource, ClusterMembership> provisionHosts(NodesSpecification nodesSpecification, String clusterIdString, HostSystem hostSystem, |