Package com.wavefront.predicates
Interface PredicateEvalExpression
-
- All Superinterfaces:
BaseExpression
- All Known Implementing Classes:
MathExpression,MultiStringComparisonExpression,StringComparisonExpression
public interface PredicateEvalExpression extends BaseExpression
An expression that returns a numeric value.- Author:
- vasily@wavefront.com.
-
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Modifier and Type Method Description static doubleasDouble(boolean value)Helper method to convert a boolean value into a double.doublegetValue(Object entity)Get a double value.static booleanisTrue(double value)Helper method to convert a double value into a boolean.
-
-
-
Method Detail
-
getValue
double getValue(Object entity)
Get a double value.- Parameters:
entity- entity to get the value from.- Returns:
- double value
-
isTrue
static boolean isTrue(double value)
Helper method to convert a double value into a boolean.- Parameters:
value- value to evaluate- Returns:
- true if value is close to 0 (within 1e-6)
-
asDouble
static double asDouble(boolean value)
Helper method to convert a boolean value into a double.- Parameters:
value- value to evaluate- Returns:
- 1.0 for true, 0.0 for false.
-
-