Class InferenceResult

java.lang.Object
com.aquima.interactions.rule.inference.InferenceResult
All Implemented Interfaces:
Serializable

public class InferenceResult extends Object implements Serializable
This class holds the result of a single inference action. The result consists of the rule that was evaluated, the result of the evaluation, and the dependencies that were used during the evaluation.
Since:
5.0
Author:
O. Kerpershoek
See Also:
  • Constructor Details

    • InferenceResult

      protected InferenceResult(SourceType type, String ruleName, Dependency[] dependencies)
      Constructs an inference result object for a specific business rule with an array of dependencies that were determined during the evaluation of that rule.
      Parameters:
      type - The resulting source type.
      ruleName - The inference rule name that produced the result.
      dependencies - The dependencies of the business rule.
  • Method Details

    • getDependencies

      public Dependency[] getDependencies()
      This method returns an array containing all the dependencies that were encountered during the evaluation of the rule. When the rule does not have any dependencies, this method will return an empty array.
      Returns:
      an array containing all the dependencies that were encountered during the evaluation of the rule.
    • addResult

      protected void addResult(SourcedValue sourcedValue)
      This method will add the sourced value to this result object.
      Parameters:
      sourcedValue - The sourced value that should be added to the result.
    • getResult

      public SourcedValue[] getResult()
      This method returns an array containing all the values that were determined by the rule. When the rule did not inference any values, an empty array will be returned.
      Returns:
      an array containing all the values that were determined by the rule.
    • hasResults

      public boolean hasResults()
      This method returns a boolean indicating if this result object contains any values that were inferenced.
      Returns:
      boolean indicating if this result object contains any values that were inferenced.
    • getValue

      public IValue getValue(String attribute)
      This method returns the inferenced value for a specific attribute. When the rule did not yield any results for the specified attribute, a null value will be returned.
      Parameters:
      attribute - The attribute for which the result is requested.
      Returns:
      The inferenced value for the specified attribute, or null when the rule did not yield any results for the specified attribute.
    • getSourceType

      public SourceType getSourceType()
    • getRuleName

      public String getRuleName()