From 44e1b1493934dd78cc671f8429ba2be4ef8dfcac Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michal=20Vav=C5=99=C3=ADk?= Date: Thu, 10 Oct 2024 00:43:59 +0200 Subject: [PATCH] Add equals and hashcode method to MemorySize --- .../runtime/configuration/MemorySize.java | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/core/runtime/src/main/java/io/quarkus/runtime/configuration/MemorySize.java b/core/runtime/src/main/java/io/quarkus/runtime/configuration/MemorySize.java index d1120f11da580..ebacf8020b948 100644 --- a/core/runtime/src/main/java/io/quarkus/runtime/configuration/MemorySize.java +++ b/core/runtime/src/main/java/io/quarkus/runtime/configuration/MemorySize.java @@ -1,6 +1,7 @@ package io.quarkus.runtime.configuration; import java.math.BigInteger; +import java.util.Objects; /** * A type representing data sizes. @@ -25,4 +26,19 @@ public long asLongValue() { public BigInteger asBigInteger() { return value; } + + @Override + public boolean equals(Object object) { + if (this == object) + return true; + if (object == null || getClass() != object.getClass()) + return false; + MemorySize that = (MemorySize) object; + return Objects.equals(value, that.value); + } + + @Override + public int hashCode() { + return Objects.hashCode(value); + } }