This is an automated email from the ASF dual-hosted git repository. ifesdjeen pushed a commit to branch CASSANDRA-19944-persistent-fields in repository https://gitbox.apache.org/repos/asf/cassandra-accord.git
commit 8690de597c4cddbd56e782f0f9ddcc46c15e406f Author: Alex Petrov <[email protected]> AuthorDate: Fri Sep 27 10:49:07 2024 +0200 Override equals for snapshot --- .../src/main/java/accord/local/CommandStores.java | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/accord-core/src/main/java/accord/local/CommandStores.java b/accord-core/src/main/java/accord/local/CommandStores.java index 5f70e794..545a7843 100644 --- a/accord-core/src/main/java/accord/local/CommandStores.java +++ b/accord-core/src/main/java/accord/local/CommandStores.java @@ -22,6 +22,7 @@ import java.util.ArrayList; import java.util.Arrays; import java.util.List; import java.util.Map; +import java.util.Objects; import java.util.function.BiFunction; import java.util.function.Consumer; import java.util.function.Function; @@ -151,6 +152,21 @@ public abstract class CommandStores this.epochs = epochs; this.ranges = ranges; } + + @Override + public boolean equals(Object o) + { + if (this == o) return true; + if (o == null || getClass() != o.getClass()) return false; + Snapshot snapshot = (Snapshot) o; + return Objects.deepEquals(epochs, snapshot.epochs) && Objects.deepEquals(ranges, snapshot.ranges); + } + + @Override + public int hashCode() + { + return Objects.hash(Arrays.hashCode(epochs), Arrays.hashCode(ranges)); + } } final long[] epochs; --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
