This is an automated email from the ASF dual-hosted git repository. szetszwo pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/ratis.git
The following commit(s) were added to refs/heads/master by this push: new 15e1d9214 RATIS-2310. Implement hashCode and equals method for SizeInBytes class. (#1272) 15e1d9214 is described below commit 15e1d92142bf677b460298e8b8326381f0a67775 Author: Nandakumar Vadivelu <na...@apache.org> AuthorDate: Mon Jun 16 00:13:57 2025 +0530 RATIS-2310. Implement hashCode and equals method for SizeInBytes class. (#1272) --- .../src/main/java/org/apache/ratis/util/SizeInBytes.java | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/ratis-common/src/main/java/org/apache/ratis/util/SizeInBytes.java b/ratis-common/src/main/java/org/apache/ratis/util/SizeInBytes.java index 0756f4fee..a2a80697f 100644 --- a/ratis-common/src/main/java/org/apache/ratis/util/SizeInBytes.java +++ b/ratis-common/src/main/java/org/apache/ratis/util/SizeInBytes.java @@ -83,4 +83,14 @@ public final class SizeInBytes { public String toString() { return description; } + + @Override + public boolean equals(Object obj) { + return obj instanceof SizeInBytes && size == ((SizeInBytes)obj).size; + } + + @Override + public int hashCode() { + return Long.hashCode(size); + } }