コード例 #1
0
  @Override
  public ConfigurationRuleBuilder perform(Operation operation) {
    for (ConfigurationRuleBuilderInterceptor interceptor : interceptors) {
      operation = interceptor.perform(operation);
    }

    rule.perform(operation);
    return this;
  }
コード例 #2
0
  @Override
  public ConfigurationRuleBuilder when(Condition condition) {
    for (ConfigurationRuleBuilderInterceptor interceptor : interceptors) {
      condition = interceptor.when(condition);
    }

    rule.when(condition);
    return this;
  }
コード例 #3
0
  @Override
  public ConfigurationRuleBuilder withId(String id) {
    for (ConfigurationRuleBuilderInterceptor interceptor : interceptors) {
      id = interceptor.withId(id);
    }

    rule.withId(id);
    return this;
  }
コード例 #4
0
  @Override
  public ConfigurationRuleBuilder withPriority(int priority) {
    for (ConfigurationRuleBuilderInterceptor interceptor : interceptors) {
      priority = interceptor.withPriority(priority);
    }

    rule.withPriority(priority);
    return this;
  }
コード例 #5
0
  @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;
  }
コード例 #6
0
  @Override
  public ConfigurationRuleBuilderWhen when(Condition condition, Condition... conditions) {
    List<Condition> list = new LinkedList<Condition>();
    list.add(condition);
    list.addAll(Arrays.asList(conditions));

    for (ConfigurationRuleBuilderInterceptor interceptor : interceptors) {
      list = interceptor.when(list);
    }

    rule.when(And.all(list.toArray(new Condition[list.size()])));
    return this;
  }
コード例 #7
0
  @Override
  public ConfigurationRuleBuilderPerform perform(Operation operation, Operation... operations) {
    List<Operation> list = new LinkedList<Operation>();
    list.add(operation);
    list.addAll(Arrays.asList(operations));

    for (ConfigurationRuleBuilderInterceptor interceptor : interceptors) {
      list = interceptor.perform(list);
    }

    rule.perform(Perform.all(list.toArray(new Operation[list.size()])));
    return this;
  }
コード例 #8
0
  @Override
  public ConfigurationRuleBuilderOtherwise otherwise(Operation operation, Operation... operations) {
    List<Operation> list = new LinkedList<Operation>();
    list.add(operation);
    list.addAll(Arrays.asList(operations));

    for (ConfigurationRuleBuilderInterceptor interceptor : interceptors) {
      list = interceptor.otherwise(list);
    }

    wrapped
        .addOtherwiseRule(rule)
        .when(Not.any(rule))
        .perform(Perform.all(list.toArray(new Operation[list.size()])));

    return this;
  }