public RuleGroup withRules(Rule... rules) {
        if (this.rules == null) {
            setRules(new java.util.ArrayList<Rule>(rules.length));
        }
        for (Rule ele : rules) {
            this.rules.add(ele);
        }
        return this;
    }
<p>
The <a>Rule</a> statements used to identify the web requests that you want to manage. Each rule includes one
top-level statement that WAF uses to identify matching web requests, and parameters that govern how WAF handles
them.
</p>
<p>
<b>NOTE:</b> This method appends the values to the existing list (if any). Use
{@link #setRules(java.util.Collection)} or {@link #withRules(java.util.Collection)} if you want to override the
existing values.
</p>

@param rules
       The <a>Rule</a> statements used to identify the web requests that you want to manage. Each rule includes
       one top-level statement that WAF uses to identify matching web requests, and parameters that govern how
       WAF handles them.
@return Returns a reference to this object so that method calls can be chained together.
aws-java-sdk-wafv2/src/main/java/com/amazonaws/services/wafv2/model/RuleGroup.java