Skip to content

Commit 607137b

Browse files
committed
add isEqual comparing by value
1 parent e6cf8ca commit 607137b

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

src/main/java/it/aboutbits/springboot/toolbox/type/ScaledBigDecimal.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -291,6 +291,10 @@ public boolean isNegativeOrZero() {
291291
return this.value().compareTo(BigDecimal.ZERO) <= 0;
292292
}
293293

294+
public boolean isEqual(ScaledBigDecimal other) {
295+
return this.compareTo(other) == 0;
296+
}
297+
294298
public boolean isBiggerThan(ScaledBigDecimal other) {
295299
return this.compareTo(other) > 0;
296300
}

0 commit comments

Comments
 (0)