List of utility methods to do BigDecimal Value Check
boolean | isJavaMathBigDecimal(Object value) Checks if specified object is instance of java.math.BigDecimal. return value instanceof java.math.BigDecimal; |
boolean | isLessOrEqualThanZero(BigDecimal value) is Less Or Equal Than Zero return value.compareTo(BigDecimal.ZERO) <= 0;
|
boolean | isLessThan(final BigDecimal thiss, final BigDecimal that) is Less Than return thiss.compareTo(that) < 0;
|
boolean | isLessThen(BigDecimal value1, BigDecimal value2) is Less Then int compareTo = value1.compareTo(value2); return compareTo < 0; |
boolean | isLong(BigDecimal inValue) is Long try { inValue.longValueExact(); } catch (final Exception e) { return false; |
boolean | isLongNumber(BigDecimal minCar) is Long Number try { Long.parseLong(minCar.toString()); return true; } catch (Exception ex) { return false; |
boolean | isLowerThanOne(@Nonnull final BigDecimal aValue) is Lower Than One return aValue.compareTo(BigDecimal.ONE) < 0;
|
boolean | isMaximumDecimalValue(BigDecimal maxValue) Checks if the specified BigDecimal value is a maximum value of a DECIMAL(x,0) data type.This method will not consider a value smaller than the BIGINT data type maximum value as a potential DECIMAL maximum value.
if (maxValue != null && maxValue.compareTo(DATATYPE_BIGINT_MAX_VALUE) > 0) { Pattern p = Pattern.compile("[^9]+"); Matcher m = p.matcher(maxValue.toString()); return !m.find(); return false; |
boolean | isMoreThanZero(BigDecimal decimal) is More Than Zero if (decimal != null) { return decimal.compareTo(BigDecimal.ZERO) > 0; return false; |
Boolean | isNegative(BigDecimal amount) is Negative return null != amount && BigDecimal.ZERO.compareTo(amount) == 1;
|