Java Utililty Methods BigDecimal Max

List of utility methods to do BigDecimal Max

Description

The list of methods to do BigDecimal Max are organized into topic(s).

Method

BigDecimalmax(BigDecimal a, BigDecimal b)
Returns the maximum value between the two.
if (a == null)
    return b;
if (b == null)
    return a;
return a.max(b);
BigDecimalmax(BigDecimal b1, BigDecimal b2)
Return max value of @param b1 and @param b2
if (b1 == null && b2 == null) {
    return null;
if (b1 == null) {
    b1 = ZERO;
if (b2 == null) {
    b2 = ZERO;
...
BigDecimalmax(BigDecimal one, BigDecimal other)
max
return (one.compareTo(other) > 0 ? one : other);
BigDecimalmax(BigDecimal... amounts)
max
BigDecimal result = null;
for (BigDecimal bigDecimal : amounts) {
    if (bigDecimal != null) {
        result = result == null ? bigDecimal : result.max(bigDecimal);
return result;
BigDecimalmax(BigDecimal... values)
Finds maximum value from array of decimals.
BigDecimal maxValue = null;
if (values != null) {
    for (BigDecimal value : values) {
        if (maxValue == null || value != null && value.compareTo(maxValue) >= 0) {
            maxValue = value;
return maxValue;
BigDecimalmax(final BigDecimal bd1, final BigDecimal bd2)
Selects the higher of two BigDecimals, preferring the non-null value if one is null.
if (bd1 == null) {
    return bd2;
if (bd2 == null) {
    return bd1;
if (bd1.compareTo(bd2) > 0) {
    return bd1;
...
BigDecimalmax(final List list)
max
BigDecimal max = BigDecimal.ZERO;
for (final BigDecimal item : list) {
    if (item.compareTo(max) > 0)
        max = item;
return max;
BigDecimalmax(List numbers)
Returns the max number in the numbers list.
return new TreeSet<BigDecimal>(numbers).last();
BigDecimalmaximum(BigDecimal... decimals)
Returns the largest of the given list of decimal numbers.
BigDecimal result = null;
if (decimals != null) {
    for (BigDecimal decimal : decimals) {
        if (decimal != null) {
            if (result == null) {
                result = decimal;
            } else {
                result = result.max(decimal);
...
BigDecimalmaximum(BigDecimal... values)
Calculate the maximum value from an array of values.
int len = values.length;
if (len == 1) {
    if (values[0] == null) {
        throw new IllegalArgumentException("Cannot passed null BigDecimal entry to maximum()");
    return values[0];
BigDecimal current = values[0];
...