Class ExpressionEvaluatorResult


  • public class ExpressionEvaluatorResult
    extends java.lang.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 Detail

      • ofFailed

        public static ExpressionEvaluatorResult ofFailed​(java.lang.String wrongValue,
                                                         java.lang.String wrongValueField)
      • isSuccessful

        public boolean isSuccessful()
      • addFieldItemStepToPath

        public void addFieldItemStepToPath​(java.lang.String fieldName)
      • addListItemStepToPath

        public void addListItemStepToPath​(int elementNumber)
      • addMapItemStepToPath

        public void addMapItemStepToPath​(java.lang.String key)
      • setWrongValue

        public void setWrongValue​(java.lang.String wrongValue)
      • getWrongValue

        public java.lang.String getWrongValue()
      • getPathToWrongValue

        public java.util.List<java.lang.String> getPathToWrongValue()