public abstract class DecimalDefault
extends java.lang.Object
Static functions to apply default values of type decimal
.
Constructor and Description |
---|
DecimalDefault() |
Modifier and Type | Method and Description |
---|---|
static java.math.BigDecimal |
ifNull(java.math.BigDecimal value,
java.math.BigDecimal defaultValue)
Return
value if it is not null , otherwise return defaultValue . |
static java.math.BigDecimal |
zeroIfNull(java.math.BigDecimal value)
Return
value if it is not null , otherwise return zero. |
public static java.math.BigDecimal ifNull(java.math.BigDecimal value, java.math.BigDecimal defaultValue)
Return value
if it is not null
, otherwise return defaultValue
.
value
- (nullable) Nullable value.defaultValue
- Default value.value
if it is not null
, otherwise return defaultValue
.public static java.math.BigDecimal zeroIfNull(java.math.BigDecimal value)
Return value
if it is not null
, otherwise return zero.
value
- (nullable) Nullable value.value
if it is not null
, otherwise return zero.