Java BigDecimal Value Check isNotZero(final BigDecimal value)

Here you can find the source of isNotZero(final BigDecimal value)

Description

is Not Zero

License

Open Source License

Parameter

Parameter Description
value a parameter

Return

true, if the given value is not null and not zero.

Declaration

public static boolean isNotZero(final BigDecimal value) 

Method Source Code


//package com.java2s;
// ProjectForge is dual-licensed.

import java.math.BigDecimal;

public class Main {
    /**//from www  . j a va2  s . c om
     * @param value
     * @return true, if the given value is not null and not zero.
     */
    public static boolean isNotZero(final Integer value) {
        return !isZeroOrNull(value);
    }

    /**
     * @param value
     * @return true, if the given value is not null and not zero.
     */
    public static boolean isNotZero(final BigDecimal value) {
        return !isZeroOrNull(value);
    }

    public static boolean isZeroOrNull(final Integer value) {
        return (value == null || value == 0);
    }

    public static boolean isZeroOrNull(final BigDecimal value) {
        return (value == null || value.compareTo(BigDecimal.ZERO) == 0);
    }
}

Related

  1. isMoreThanZero(BigDecimal decimal)
  2. isNegative(BigDecimal amount)
  3. isNegative(BigDecimal inValue)
  4. isNotNullOrZero(final BigDecimal number)
  5. isNotSameAbsValue(final BigDecimal v1, final BigDecimal v2)
  6. isNotZeroPositive(BigDecimal value)
  7. isNull(BigDecimal bdg)
  8. isNull(final BigDecimal s)
  9. isNullOrZero(BigDecimal number)