添加 BigDecimal 的 equal 方法。

feature/net-util
ZhouXY108 2023-05-27 04:09:46 +08:00
parent 716cda893d
commit d1dfbd273e
1 changed files with 14 additions and 0 deletions

View File

@ -0,0 +1,14 @@
package xyz.zhouxy.plusone.commons.util;
import java.math.BigDecimal;
public class BigDecimals {
public static boolean equals(BigDecimal a, BigDecimal b) {
return (a == b) || (a != null && a.compareTo(b) == 0);
}
private BigDecimals() {
throw new IllegalStateException("Utility class");
}
}