Here you can find the source of equals(final BigDecimal pValue1, final BigDecimal pValue2)
Parameter | Description |
---|---|
pValue1 | The first value. |
pValue2 | The second value. |
public static final boolean equals(final BigDecimal pValue1, final BigDecimal pValue2)
//package com.java2s; /**/* w w w .ja v a 2 s.co m*/ * (C) Copyright 2007, Deft Labs. * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published * by the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with this program. If not, see <http://www.gnu.org/licenses/>. */ import java.math.BigInteger; import java.math.BigDecimal; public class Main { /** * Check to see if doubles are equal (null safe). * @param pValue1 The first value. * @param pValue2 The second value. */ public static final boolean equals(final Double pValue1, final Double pValue2) { if (pValue1 != null) return pValue1.equals(pValue2); if (pValue2 != null) return pValue1.equals(pValue2); return false; } /** * Check to see if longs are equal (null safe). * @param pValue1 The first value. * @param pValue2 The second value. */ public static final boolean equals(final Long pValue1, final Long pValue2) { if (pValue1 != null) return pValue1.equals(pValue2); if (pValue2 != null) return pValue1.equals(pValue2); return false; } /** * Check to see if ints are equal (null safe). * @param pValue1 The first value. * @param pValue2 The second value. */ public static final boolean equals(final Integer pValue1, final Integer pValue2) { if (pValue1 != null) return pValue1.equals(pValue2); if (pValue2 != null) return pValue1.equals(pValue2); return false; } /** * Check to see if the shorts are equal (null safe). * @param pValue1 The first value. * @param pValue2 The second value. */ public static final boolean equals(final Short pValue1, final Short pValue2) { if (pValue1 != null) return pValue1.equals(pValue2); if (pValue2 != null) return pValue1.equals(pValue2); return false; } /** * Check to see if the big ints are equal (null safe). * @param pValue1 The first value. * @param pValue2 The second value. */ public static final boolean equals(final BigInteger pValue1, final BigInteger pValue2) { if (pValue1 == null || pValue2 == null) return false; return pValue1.equals(pValue2); } /** * Check to see if the big decimals are equal (null safe). * @param pValue1 The first value. * @param pValue2 The second value. */ public static final boolean equals(final BigDecimal pValue1, final BigDecimal pValue2) { if (pValue1 == null || pValue2 == null) return false; return pValue1.equals(pValue2); } }