Class EvaluationResult

java.lang.Object
de.telekom.jsonfilter.operator.EvaluationResult

public class EvaluationResult extends Object
  • Method Details

    • empty

      public static EvaluationResult empty()
      Creates an EvaluationResult instance indicating no operation.
      Returns:
      EvaluationResult the created evaluation result, with default values and "noop" operator name.
    • valid

      public static EvaluationResult valid(Operator op)
      Creates a valid EvaluationResult instance based on the given Operator.
      Parameters:
      op - the operator for this evaluation.
      Returns:
      EvaluationResult the created evaluation result, which is valid by default.
    • valid

      public static EvaluationResult valid(Operator op, List<EvaluationResult> evaluationResults)
      Creates a valid EvaluationResult instance based on the given Operator and other evaluation results.
      Parameters:
      op - the operator for this evaluation.
      evaluationResults - the list of evaluation results for child operators.
      Returns:
      EvaluationResult the created evaluation result, which is valid by default.
    • withError

      public static EvaluationResult withError(Operator op, String causeDescription)
      Creates an EvaluationResult instance indicating an error in the evaluation process.
      Parameters:
      op - the operator that caused the error.
      causeDescription - the description of the error.
      Returns:
      EvaluationResult the created evaluation result, which is not valid by default.
    • fromResultList

      public static EvaluationResult fromResultList(LogicOperator logicOperator, List<EvaluationResult> evaluationResults)
      Creates an EvaluationResult instance based on the results of an evaluation process.
      Parameters:
      logicOperator - the operator for this evaluation.
      evaluationResults - the list of evaluation results for child operators.
      Returns:
      EvaluationResult the created evaluation result, which is valid if all/any child evaluations are valid.
    • toString

      public String toString()
      Overrides:
      toString in class Object