public class EvalHelper extends Object
Modifier and Type | Class and Description |
---|---|
static class |
EvalHelper.PropertyValueResult |
Modifier and Type | Field and Description |
---|---|
static org.slf4j.Logger |
LOG |
Constructor and Description |
---|
EvalHelper() |
Modifier and Type | Method and Description |
---|---|
static Object |
coerceNumber(Object value) |
static Boolean |
compare(Object left,
Object right,
EvaluationContext ctx,
BiPredicate<Comparable,Comparable> op)
Compares left and right operands using the given predicate and returns TRUE/FALSE accordingly
|
static Method |
getAccessor(Class<?> clazz,
String field)
JavaBean -spec compliant accessor.
|
static BigDecimal |
getBigDecimalOrNull(Object value) |
static Boolean |
getBooleanOrNull(Object value) |
static EvalHelper.PropertyValueResult |
getDefinedValue(Object current,
String property) |
static Method |
getGenericAccessor(Class<?> clazz,
String field)
FEEL annotated or else Java accessor.
|
static Object |
getValue(Object current,
String property)
Deprecated.
this method cannot distinguish null because: 1. property undefined for current, 2. an error, 3. a properly defined property value valorized to null.
|
static Boolean |
isEqual(Object left,
Object right,
EvaluationContext ctx)
Compares left and right for equality applying FEEL semantics to specific data types
|
static String |
lcFirst(String name) |
static String |
normalizeVariableName(String name) |
static Optional<String> |
propertyFromAccessor(Method accessor)
Inverse of
getAccessor(Class, String) |
static String |
ucFirst(String name) |
static String |
unescapeString(String text) |
public static BigDecimal getBigDecimalOrNull(Object value)
public static EvalHelper.PropertyValueResult getDefinedValue(Object current, String property)
public static Object getValue(Object current, String property)
getDefinedValue(Object, String)
method instead.public static Method getGenericAccessor(Class<?> clazz, String field)
clazz
- field
- public static Method getAccessor(Class<?> clazz, String field)
clazz
- field
- public static Optional<String> propertyFromAccessor(Method accessor)
getAccessor(Class, String)
public static Boolean compare(Object left, Object right, EvaluationContext ctx, BiPredicate<Comparable,Comparable> op)
left
- right
- ctx
- op
- public static Boolean isEqual(Object left, Object right, EvaluationContext ctx)
left
- right
- ctx
- Copyright © 2001–2018 JBoss by Red Hat. All rights reserved.