Java Utililty Methods BigDecimal Value Check

List of utility methods to do BigDecimal Value Check

Description

The list of methods to do BigDecimal Value Check are organized into topic(s).

Method

booleanisZero(BigDecimal bd)
is Zero
if (bd == null) {
    return true;
return isZero(bd.doubleValue());
BooleanisZero(BigDecimal d)
is Zero
return d.equals(BigDecimal.ZERO);
booleanisZero(BigDecimal decimal)
is Zero
return decimal.compareTo(BigDecimal.ZERO) == 0;
booleanisZero(BigDecimal inValue)
is Zero
return inValue != null && BigDecimal.ZERO.compareTo(inValue) == 0;
booleanisZero(final BigDecimal b)
Null save comparison against BigDecimal#ZERO .
if (b != null && b.equals(ZERO)) {
    return true;
} else {
    return false;
booleanisZero(final BigDecimal value)
is Zero
return value != null && value.signum() == 0;
booleanisZeroOrNull(final BigDecimal value)
is Zero Or Null
return (value == null || value.compareTo(BigDecimal.ZERO) == 0);