Java Utililty Methods BigDecimal Equal

List of utility methods to do BigDecimal Equal

Description

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

Method

booleanequals(final BigDecimal pValue1, final BigDecimal pValue2)
Check to see if the big decimals are equal (null safe).
if (pValue1 == null || pValue2 == null)
    return false;
return pValue1.equals(pValue2);
booleanequalsBigDecimal(BigDecimal bd1, BigDecimal bd2)
equals Big Decimal
if (bd1.compareTo(bd2) == 0) {
    return true;
} else {
    return false;
booleanisEqual(BigDecimal aLhs, BigDecimal aRhs)
FILLIN
return ((aLhs == null && aRhs == null) || (aLhs != null && aRhs != null && aLhs.compareTo(aRhs) == 0));
booleanisEqual(BigDecimal n1, BigDecimal n2, int precision)
Checks two BigDecimal with given precision - number of nulls after point.
BigDecimal alpha = BigDecimal.ONE.movePointLeft(precision);
return n1.subtract(n2).abs().compareTo(alpha) <= 0;
booleanisEqual(BigDecimal value1, BigDecimal value2)
Compares this value1 to value2.
return value1.compareTo(value2) == 0;
booleanisEqual(final BigDecimal value1, final BigDecimal value2)
Compares two given BigDecimals.
if (value1 == null) {
    return (value2 == null) ? true : false;
if (value2 == null) {
    return false;
return value1.compareTo(value2) == 0;
booleanisEqualsToZero(BigDecimal value)
is Equals To Zero
return value.compareTo(BigDecimal.ZERO) == 0;