Here you can find the source of isEqual(final BigDecimal value1, final BigDecimal value2)
Parameter | Description |
---|---|
value1 | a parameter |
value2 | a parameter |
public static boolean isEqual(final BigDecimal value1, final BigDecimal value2)
//package com.java2s; // ProjectForge is dual-licensed. import java.math.BigDecimal; public class Main { /**/*w ww . j a v a2 s.c om*/ * Compares two given BigDecimals. They are equal if the value is equal independent of the scale (5.70 is equals to 5.7 and null is equals * null, but null is not equals to 0). * @param value1 * @param value2 * @return * @see BigDecimal#compareTo(BigDecimal) */ public static boolean isEqual(final BigDecimal value1, final BigDecimal value2) { if (value1 == null) { return (value2 == null) ? true : false; } if (value2 == null) { return false; } return value1.compareTo(value2) == 0; } /** * Compares two given Integers using compareTo method. * @param value1 * @param value * @return * @see Integer#compareTo(Integer) */ public static boolean isEqual(final Integer value1, final Integer value) { if (value1 == null) { return (value == null) ? true : false; } if (value == null) { return false; } return value1.compareTo(value) == 0; } }