Class DecimalExpressionVariable
java.lang.Object
com.broadleafcommerce.rulesengine.expression.util.DecimalExpressionVariable
- All Implemented Interfaces:
ExpressionVariable
Common, null-safe, decimal operations.
- Author:
- Nathan Moore (nathandmoore)
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiongetName()
double
Returns the max double value.double
Returns the min double value.double
toDouble
(BigDecimal field) Returns the double value of theBigDecimal
field.double
toDouble
(BigDecimal field, double defaultValue) Returns the double value of theBigDecimal
field.
-
Field Details
-
NAME
- See Also:
-
-
Constructor Details
-
DecimalExpressionVariable
public DecimalExpressionVariable()
-
-
Method Details
-
getName
- Specified by:
getName
in interfaceExpressionVariable
- Returns:
- Name of the variable, must not be null
-
toDouble
- Parameters:
field
- BigDecimal to convert to double.- Returns:
- the double value of the
BigDecimal
field orminDoubleValue()
if null.
-
toDouble
- Parameters:
field
- BigDecimal to convert to double.defaultValue
- Value to default to iffield
is null- Returns:
- the double value of the
BigDecimal
field ordefaultValue
if null.
-
maxDoubleValue
public double maxDoubleValue()Returns the max double value.- Returns:
Double.MAX_VALUE
-
minDoubleValue
public double minDoubleValue()Returns the min double value.- Returns:
Double.MIN_VALUE
-