Interface IRule
-
- All Known Implementing Classes:
AbstractRule
public interface IRule
Rules are used for analyzing flight recordings and creating results that can inform a user about problems.The key method to implement is
createEvaluation(IItemCollection, IPreferenceValueProvider, IResultValueProvider)
.getId()
must return an id that is unique for each implementation andgetName()
should return a human readable name.Rule instances may be reused for multiple evaluations with different input data so it is strongly recommended that implementations be stateless.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description RunnableFuture<IResult>
createEvaluation(IItemCollection items, IPreferenceValueProvider preferenceValueProvider, IResultValueProvider dependencyResults)
Gets a future representing the result of the evaluation of this rule.Collection<TypedPreference<?>>
getConfigurationAttributes()
Gets information about which attributes may be configured during rule evaluation.String
getId()
String
getName()
Map<String,RulesToolkit.EventAvailability>
getRequiredEvents()
Collection<TypedResult<?>>
getResults()
Gets information about which results may be part of anIResult
instance.String
getTopic()
-
-
-
Method Detail
-
getId
String getId()
- Returns:
- a unique id for this rule implementation
-
getTopic
String getTopic()
- Returns:
- the topic for this rule, may be
null
-
getName
String getName()
- Returns:
- a human readable name for this rule
-
getRequiredEvents
Map<String,RulesToolkit.EventAvailability> getRequiredEvents()
- Returns:
- a map of all event type IDs and the minimum
RulesToolkit.EventAvailability
this rule requires for that event type
-
createEvaluation
RunnableFuture<IResult> createEvaluation(IItemCollection items, IPreferenceValueProvider preferenceValueProvider, IResultValueProvider dependencyResults)
Gets a future representing the result of the evaluation of this rule. Running the RunnableFuture is the responsibility of the caller of this method, not the implementation.- Parameters:
items
- items to evaluatepreferenceValueProvider
- Provider of configuration values used for evaluation. The attributes that will be asked for from the provider should be provided bygetConfigurationAttributes()
.dependencyResults
- Provider of results from rules evaluated prior to this rule and which this rule explicitly depends on via aDependsOn
annotation. The attributes that will be asked for from the provider will be provided by each dependant rule, e.g. via public static constants.- Returns:
- a RunnableFuture that when run will return the evaluation result
-
getConfigurationAttributes
Collection<TypedPreference<?>> getConfigurationAttributes()
Gets information about which attributes may be configured during rule evaluation.- Returns:
- a list of configuration attributes
-
getResults
Collection<TypedResult<?>> getResults()
Gets information about which results may be part of anIResult
instance.- Returns:
- a list of result attributes
-
-