Class ExpressionEvaluatorResult
- java.lang.Object
-
- org.drools.scenariosimulation.backend.expression.ExpressionEvaluatorResult
-
public class ExpressionEvaluatorResult extends Object
This DTO holds info related to an expression evaluation. - successful: field represents status of involved evaluation (successful or failed); - pathToWrongValue: a list which contains the steps to describe the wrong value. In case of nested object or collections, can require multiple steps (eg. Author.books). In case of a list, conversion is to report the Item number (eg. Author.books.Item(2).isAvailable) - wrongValue: The actual wrong value Instantiated objects can be accessed only to retrieve the success status and to generate an error message, if evaluation failed, based on wrongValue and its path.
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddFieldItemStepToPath(String fieldName)voidaddListItemStepToPath(int elementNumber)voidaddMapItemStepToPath(String key)List<String>getPathToWrongValue()StringgetWrongValue()booleanisSuccessful()static ExpressionEvaluatorResultof(boolean successful)static ExpressionEvaluatorResultofFailed()static ExpressionEvaluatorResultofFailed(String wrongValue, String wrongValueField)static ExpressionEvaluatorResultofSuccessful()voidsetWrongValue(String wrongValue)
-
-
-
Method Detail
-
of
public static ExpressionEvaluatorResult of(boolean successful)
-
ofSuccessful
public static ExpressionEvaluatorResult ofSuccessful()
-
ofFailed
public static ExpressionEvaluatorResult ofFailed()
-
ofFailed
public static ExpressionEvaluatorResult ofFailed(String wrongValue, String wrongValueField)
-
isSuccessful
public boolean isSuccessful()
-
addFieldItemStepToPath
public void addFieldItemStepToPath(String fieldName)
-
addListItemStepToPath
public void addListItemStepToPath(int elementNumber)
-
addMapItemStepToPath
public void addMapItemStepToPath(String key)
-
setWrongValue
public void setWrongValue(String wrongValue)
-
getWrongValue
public String getWrongValue()
-
-