11/*
2- * Copyright 2011 <a href="mailto:lincolnbaxter@gmail.com">Lincoln Baxter, III</a>
2+ * Copyright 2013 <a href="mailto:lincolnbaxter@gmail.com">Lincoln Baxter, III</a>
33 *
44 * Licensed under the Apache License, Version 2.0 (the "License");
55 * you may not use this file except in compliance with the License.
1818import java .util .List ;
1919
2020/**
21- * @author <a href="mailto:lincolnbaxter@gmail.com">Lincoln Baxter, III</a>
21+ * An intermediate stage {@link Rule} configuration.
2222 *
23+ * @author <a href="mailto:lincolnbaxter@gmail.com">Lincoln Baxter, III</a>
2324 */
24- public class ConfigurationRuleBuilder extends ConfigurationBuilder
25+ public class ConfigurationRuleBuilder extends ConfigurationBuilder implements
26+ ConfigurationRuleBuilderCustom ,
27+ ConfigurationRuleBuilderWhen ,
28+ ConfigurationRuleBuilderPerform ,
29+ ConfigurationRuleBuilderOtherwise ,
30+ ConfigurationRuleBuilderWithId ,
31+ ConfigurationRuleBuilderWithPriority ,
32+ ConfigurationRuleBuilderWithPriorityAndId
2533{
2634 private final ConfigurationBuilder wrapped ;
2735 private final RuleBuilder rule ;
@@ -39,14 +47,15 @@ public ConfigurationRuleBuilder addRule(final Rule rule)
3947 }
4048
4149 @ Override
42- public ConfigurationRuleBuilder addRule ()
50+ public ConfigurationRuleBuilderCustom addRule ()
4351 {
4452 return wrapped .addRule ();
4553 }
4654
4755 /**
4856 * Set the {@link Condition} of this {@link Rule} instance.
4957 */
58+ @ Override
5059 public ConfigurationRuleBuilder when (final Condition condition )
5160 {
5261 rule .when (condition );
@@ -56,6 +65,7 @@ public ConfigurationRuleBuilder when(final Condition condition)
5665 /**
5766 * Perform the given {@link Operation} when the conditions set in this {@link Rule} are met.
5867 */
68+ @ Override
5969 public ConfigurationRuleBuilder perform (final Operation operation )
6070 {
6171 rule .perform (operation );
@@ -65,6 +75,7 @@ public ConfigurationRuleBuilder perform(final Operation operation)
6575 /**
6676 * Perform the given {@link Operation} when the conditions set in this {@link Rule} fail to be met.
6777 */
78+ @ Override
6879 public ConfigurationRuleBuilder otherwise (final Operation operation )
6980 {
7081 rule .otherwise (operation );
@@ -76,23 +87,25 @@ public ConfigurationRuleBuilder otherwise(final Operation operation)
7687 * {@link ConfigurationProvider} from which this rule was returned, then relocate this rule to its new priority
7788 * position in the compiled rule set.
7889 */
90+ @ Override
7991 public ConfigurationRuleBuilder withPriority (int priority )
8092 {
8193 rule .withPriority (priority );
8294 return this ;
8395 }
8496
8597 /**
86- * Set the ID for the current rule.
98+ * Set the ID for the current {@link Rule}. This may be used in logging and for rule lookup purposes .
8799 */
100+ @ Override
88101 public ConfigurationRuleBuilder withId (String id )
89102 {
90103 rule .withId (id );
91104 return this ;
92105 }
93106
94107 /**
95- * Provides access to the rule builder for the current rule .
108+ * Provides access to the {@link RuleBuilder} for the current {@link Rule} .
96109 */
97110 public RuleBuilder getRuleBuilder ()
98111 {
0 commit comments