Skip to content

Commit

Permalink
Add equals and hashcode method to MemorySize
Browse files Browse the repository at this point in the history
  • Loading branch information
michalvavrik committed Oct 9, 2024
1 parent b779ee9 commit 44e1b14
Showing 1 changed file with 16 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package io.quarkus.runtime.configuration;

import java.math.BigInteger;
import java.util.Objects;

/**
* A type representing data sizes.
Expand All @@ -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);
}
}

0 comments on commit 44e1b14

Please sign in to comment.