Java BigDecimal Value Check isZero(BigDecimal inValue)

Here you can find the source of isZero(BigDecimal inValue)

Description

is Zero

License

Open Source License

Declaration

public static boolean isZero(BigDecimal inValue) 

Method Source Code

//package com.java2s;
//License from project: Open Source License 

import java.math.BigDecimal;

public class Main {
    public static boolean isZero(BigDecimal inValue) {

        return inValue != null && BigDecimal.ZERO.compareTo(inValue) == 0;
    }/*from   www  . j ava2s. c o m*/

    public static <T extends Comparable<T>> int compareTo(T t1, T t2) {
        return compareToNullLast(t1, t2);
    }

    public static <T extends Comparable<T>> int compareToNullLast(T t1, T t2) {
        if (t1 == t2) {
            return 0;
        } else if (t1 == null) {
            return 1;
        } else if (t2 == null) {
            return -1;
        } else {
            return t1.compareTo(t2);
        }
    }
}

Related

  1. isValidLongitude(BigDecimal value)
  2. isValueEquals(BigDecimal decimal1, BigDecimal decimal2)
  3. isZero(BigDecimal bd)
  4. isZero(BigDecimal d)
  5. isZero(BigDecimal decimal)
  6. isZero(final BigDecimal b)
  7. isZero(final BigDecimal value)
  8. isZeroOrNull(final BigDecimal value)