public QueryResult withWarnings(Warning... warnings) {
        if (this.warnings == null) {
            setWarnings(new java.util.ArrayList<Warning>(warnings.length));
        }
        for (Warning ele : warnings) {
            this.warnings.add(ele);
        }
        return this;
    }
<p>
A list of warning codes and their messages on problems with your query.
</p>
<p>
Amazon Kendra currently only supports one type of warning, which is a warning on invalid syntax used in the
query. For examples of invalid query syntax, see <a
href="https://docs.aws.amazon.com/kendra/latest/dg/searching-example.html#searching-index-query-syntax">Searching
with advanced query syntax</a>.
</p>
<p>
<b>NOTE:</b> This method appends the values to the existing list (if any). Use
{@link #setWarnings(java.util.Collection)} or {@link #withWarnings(java.util.Collection)} if you want to override
the existing values.
</p>

@param warnings
       A list of warning codes and their messages on problems with your query.</p>
       <p>
       Amazon Kendra currently only supports one type of warning, which is a warning on invalid syntax used in
       the query. For examples of invalid query syntax, see <a
       href="https://docs.aws.amazon.com/kendra/latest/dg/searching-example.html#searching-index-query-syntax"
       >Searching with advanced query syntax</a>.
@return Returns a reference to this object so that method calls can be chained together.
aws-java-sdk-kendra/src/main/java/com/amazonaws/services/kendra/model/QueryResult.java