@Override public ConfigurationRuleParameterBuilder where(String name) { return new ConfigurationRuleParameterBuilder(this, rule.where(name)); }
@Override public Configuration getConfiguration(RuleLoaderContext ruleLoaderContext) { return ConfigurationBuilder.begin() .addRule() .perform(new GraphOperation() { @Override public void perform(GraphRewrite event, EvaluationContext context) { createIndexReport(event.getGraphContext()); } }); } // @formatter:on
@Override public ConfigurationRuleBuilder otherwise(Operation operation) { for (ConfigurationRuleBuilderInterceptor interceptor : interceptors) { operation = interceptor.otherwise(operation); } wrapped.addOtherwiseRule(rule) .when(Not.any(rule)) .perform(operation); return this; }
/** * Perform the given {@link Operation} when the conditions set in this {@link Rule} are met. */ public RuleBuilder perform(final Operation operation) { if (this.operation == null) this.operation = operation; else if (operation instanceof OperationBuilder) this.operation = ((OperationBuilder) this.operation).and(operation); else this.operation = Operations.wrap(this.operation).and(operation); return this; }
/** * Set the {@link Condition} of this {@link Rule} instance. */ public RuleBuilder when(final Condition condition) { if (this.condition == null) this.condition = condition; else if (condition instanceof ConditionBuilder) this.condition = ((ConditionBuilder) this.condition).and(condition); else this.condition = Conditions.wrap(this.condition).and(condition); return this; }
/** * Add a new fluent {@link Rule}. */ @Override public ConfigurationRuleBuilderCustom addRule() { RuleBuilder rule = RuleBuilder.define(); setDefaultLocation(rule); rules.add(rule); return new ConfigurationRuleBuilder(this, rule); }
@Override public boolean evaluate(final Rewrite event, final EvaluationContext context) { Conditions.incrementNegationCount(context, 1); try { return condition.evaluate(event, context) != true; } finally { Conditions.incrementNegationCount(context, -1); } }
@Override public Configuration getConfiguration(RuleLoaderContext ruleLoaderContext) { return ConfigurationBuilder.begin() .addRule() .perform(new GraphOperation() { @Override public void perform(GraphRewrite event, EvaluationContext context) { createIndexReport(event.getGraphContext()); } }); } // @formatter:on
@Override public ConfigurationRuleBuilder otherwise(Operation operation) { for (ConfigurationRuleBuilderInterceptor interceptor : interceptors) { operation = interceptor.otherwise(operation); } wrapped.addOtherwiseRule(rule) .when(Not.any(rule)) .perform(operation); return this; }
/** * Perform the given {@link Operation} when the conditions set in this {@link Rule} are met. */ public RuleBuilder perform(final Operation operation) { if (this.operation == null) this.operation = operation; else if (operation instanceof OperationBuilder) this.operation = ((OperationBuilder) this.operation).and(operation); else this.operation = Operations.wrap(this.operation).and(operation); return this; }
@Override public ConfigurationRuleParameterBuilder where(String name) { return new ConfigurationRuleParameterBuilder(this, rule.where(name)); }