java.lang.Object
software.amazon.smithy.rulesengine.language.syntax.rule.Rule.Builder
Enclosing class:
Rule

public static final class Rule.Builder extends Object
  • Method Details

    • conditions

      @SafeVarargs public final Rule.Builder conditions(Into<Condition>... conditions)
    • conditions

      public Rule.Builder conditions(List<Condition> conditions)
    • condition

      public Rule.Builder condition(Into<Condition> condition)
    • endpoint

      public Rule endpoint(Endpoint endpoint)
    • error

      public Rule error(Node error)
    • error

      public Rule error(String error)
    • treeRule

      public Rule treeRule(Rule... rules)
    • treeRule

      @SafeVarargs public final Rule treeRule(List<Rule>... rules)
    • description

      public Rule.Builder description(String description)
    • errorOrElse

      @SafeVarargs public final Rule.Builder errorOrElse(String error, Into<Condition>... condition)
      If `condition` IS met, return an error. Otherwise, proceed with the rules generated by the returned builder
    • validateOrElse

      public Rule.Builder validateOrElse(Into<Condition> condition, String error)
      If `condition` is not met, return an error. Otherwise, proceed with the rules generated by the returned builder.

      This method returns a new builder that must be used!

      Parameters:
      condition - a coercible Condition
      error - an error description if the condition is not matched
      Returns:
      a new builder to attach subsequent rules to
    • validateOrElse

      public Rule.Builder validateOrElse(String error, Into<Condition>... condition)
      If `condition` is not met, return an error. Otherwise, proceed with the rules generated by the returned builder.

      This method returns a new builder that must be used!

      Parameters:
      condition - a coercible Condition
      error - an error description if the condition is not matched
      Returns:
      new builder to attach subsequent rules to