Package org.jeasy.rules.core
Class RuleBuilder
java.lang.Object
org.jeasy.rules.core.RuleBuilder
Builder to create
Rule
instances.- Author:
- Mahmoud Ben Hassine ([email protected])
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbuild()
Create a newRule
.description
(String description) Set rule description.Set rule name.priority
(int priority) Set rule priority.Add an action to the rule.Set rule condition.
-
Constructor Details
-
RuleBuilder
public RuleBuilder()
-
-
Method Details
-
name
Set rule name.- Parameters:
name
- of the rule- Returns:
- the builder instance
-
description
Set rule description.- Parameters:
description
- of the rule- Returns:
- the builder instance
-
priority
Set rule priority.- Parameters:
priority
- of the rule- Returns:
- the builder instance
-
when
Set rule condition.- Parameters:
condition
- of the rule- Returns:
- the builder instance
-
then
Add an action to the rule.- Parameters:
action
- to add- Returns:
- the builder instance
-
build
Create a newRule
.- Returns:
- a new rule instance
-