Class InferenceResult
java.lang.Object
com.aquima.interactions.rule.inference.InferenceResult
- All Implemented Interfaces:
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 Summary
ConstructorsModifierConstructorDescriptionprotected
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. -
Method Summary
Modifier and TypeMethodDescriptionprotected void
addResult
(SourcedValue sourcedValue) This method will add the sourced value to this result object.This method returns an array containing all the dependencies that were encountered during the evaluation of the rule.This method returns an array containing all the values that were determined by the rule.This method returns the inferenced value for a specific attribute.boolean
This method returns a boolean indicating if this result object contains any values that were inferenced.
-
Constructor Details
-
InferenceResult
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
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
This method will add the sourced value to this result object.- Parameters:
sourcedValue
- The sourced value that should be added to the result.
-
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
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
-
getRuleName
-