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

public static final class Rule.Builder extends Object
A builder used to create a Rule class.
  • Method Details

    • conditions

      public Rule.Builder conditions(ToCondition... conditions)
    • conditions

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

      public Rule.Builder condition(ToCondition 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

      public Rule.Builder errorOrElse(String error, ToCondition... condition)
      If `condition` IS 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
    • validateOrElse

      public Rule.Builder validateOrElse(String error, ToCondition... 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