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()doubleReturns the max double value.doubleReturns the min double value.doubletoDouble(BigDecimal field) Returns the double value of theBigDecimalfield.doubletoDouble(BigDecimal field, double defaultValue) Returns the double value of theBigDecimalfield.
-
Field Details
-
NAME
- See Also:
-
-
Constructor Details
-
DecimalExpressionVariable
public DecimalExpressionVariable()
-
-
Method Details
-
getName
- Specified by:
getNamein interfaceExpressionVariable- Returns:
- Name of the variable, must not be null
-
toDouble
- Parameters:
field- BigDecimal to convert to double.- Returns:
- the double value of the
BigDecimalfield orminDoubleValue()if null.
-
toDouble
- Parameters:
field- BigDecimal to convert to double.defaultValue- Value to default to iffieldis null- Returns:
- the double value of the
BigDecimalfield ordefaultValueif 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
-