Class Rule.Builder

  • Enclosing class:
    Rule

    public static final class Rule.Builder
    extends java.lang.Object
    • Method Detail

      • error

        public Rule error​(Node error)
      • error

        public Rule error​(java.lang.String error)
      • treeRule

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

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

        public Rule.Builder description​(java.lang.String description)
      • errorOrElse

        @SafeVarargs
        public final Rule.Builder errorOrElse​(java.lang.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,
                                           java.lang.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​(java.lang.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