Chained, Unchained and limited rule engines
[reguloj.git] / src / main / java / com / github / sebhoss / reguloj / RuleEngines.java
blobbdda4fdb00ce27598af91e0cb9ea05b0bc4fee85
1 package com.github.sebhoss.reguloj;
3 /**
4 * Utility class which helps creating new {@link RuleEngine rule engines}.
5 *
6 * @see RuleEngine
7 */
8 public final class RuleEngines {
10 /**
11 * @return A rule engine which supports rule chaining.
13 public static <CONTEXT extends Context<?>> RuleEngine<CONTEXT> chained() {
14 return new ChainedRuleEngine<>();
17 /**
18 * @return A rule engine which does not support rule chaining.
20 public static <CONTEXT extends Context<?>> RuleEngine<CONTEXT> unchained() {
21 return new UnchainedRuleEngine<>();
24 /**
25 * @param maximumNumberOfRuns
26 * The maximum number of runs to perform.
27 * @return A rule engine which does not support rule chaining.
29 public static <CONTEXT extends Context<?>> RuleEngine<CONTEXT> limited(final int maximumNumberOfRuns) {
30 return new LimitedRuleEngine<>(maximumNumberOfRuns);
33 private RuleEngines() {
34 // do nothing