Package com.helixframework.rules.rule
Interface Rule
public interface Rule
Interface that all rules must implement.
-
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionvoidapply(RuleContext<?> ctx) Executes the rule with a default timeout.<T> Tapply(RuleContext<?> ctx, Class<T> outputType) Executes the rules and returns a result.<T> Tapply(RuleContext<?> ctx, Class<T> outputType, Duration timeout) Executes the rules, with a custom timeout, and returns a result.voidapply(RuleContext<?> ctx, Duration timeout) Executes the rule with a custom timeout.Gets the classification of the rule.Gets a set of rules for which this rule depends upon.Gets the description of the rule.default IntegerGets the number of times the rule should be retried in the event of a failure.getName()Gets the name of the rule.getTags()Gets the rule's tags.default DurationGets the timeout.getType()Gets the type of rule.
-
Field Details
-
DEFAULT_TIMEOUT
Default rule timeout. -
DEFAULT_MAX_RETRIES
Default rule max retries.
-
-
Method Details
-
apply
Executes the rule with a default timeout.- Parameters:
ctx- rule context
-
apply
Executes the rule with a custom timeout.- Parameters:
ctx- rule contexttimeout- timeout
-
apply
Executes the rules and returns a result.- Type Parameters:
T- return type- Parameters:
ctx- rule contectoutputType- rule output type- Returns:
- result of rule
-
apply
Executes the rules, with a custom timeout, and returns a result.- Type Parameters:
T- return type- Parameters:
ctx- rule contextoutputType- rule output typetimeout- timeout- Returns:
- result of rule
-
getName
String getName()Gets the name of the rule.- Returns:
- rule name
-
getClassification
String getClassification()Gets the classification of the rule.- Returns:
- rule classification
-
getDependencies
Gets a set of rules for which this rule depends upon.- Returns:
- rule dependencies
-
getDescription
String getDescription()Gets the description of the rule.- Returns:
- rule description
-
getTags
Gets the rule's tags.- Returns:
- rule tags
-
getType
RuleType getType()Gets the type of rule.- Returns:
- rule type
-
getTimeout
Gets the timeout.- Returns:
- timeout
-
getMaxRetries
Gets the number of times the rule should be retried in the event of a failure.- Returns:
- max retries
-