Java BigDecimal Equal bigDecimalEqualsOrBothNull(BigDecimal obj1, BigDecimal obj2)

Here you can find the source of bigDecimalEqualsOrBothNull(BigDecimal obj1, BigDecimal obj2)

Description

big Decimal Equals Or Both Null

License

Open Source License

Declaration

public static boolean bigDecimalEqualsOrBothNull(BigDecimal obj1, BigDecimal obj2) 

Method Source Code


//package com.java2s;
import java.math.BigDecimal;

public class Main {
    public static boolean bigDecimalEqualsOrBothNull(BigDecimal obj1, BigDecimal obj2) {
        if (obj1 == null && obj2 == null) {
            return true;
        }/*from  w  w w . jav a2s  . c  o  m*/
        if (obj1 != null && obj2 != null) {
            return obj1.compareTo(obj2) == 0;
        }
        return false;
    }
}

Related

  1. bigDecimalEqual(BigDecimal a, BigDecimal b)
  2. bigDecimalEquals(BigDecimal a, Number b)
  3. equalBD(BigDecimal val1, BigDecimal val2)
  4. equals(BigDecimal a, BigDecimal b)
  5. equals(BigDecimal bd1, BigDecimal bd2)
  6. equals(BigDecimal decimal, double number)