public DescribeDomainsRequest withDomainNames(String... domainNames) {
        if (this.domainNames == null) {
            setDomainNames(new java.util.ArrayList<String>(domainNames.length));
        }
        for (String ele : domainNames) {
            this.domainNames.add(ele);
        }
        return this;
    }
<p>
Array of OpenSearch Service domain names that you want information about. You must specify at least one domain
name.
</p>
<p>
<b>NOTE:</b> This method appends the values to the existing list (if any). Use
{@link #setDomainNames(java.util.Collection)} or {@link #withDomainNames(java.util.Collection)} if you want to
override the existing values.
</p>

@param domainNames
       Array of OpenSearch Service domain names that you want information about. You must specify at least one
       domain name.
@return Returns a reference to this object so that method calls can be chained together.
aws-java-sdk-opensearch/src/main/java/com/amazonaws/services/opensearch/model/DescribeDomainsRequest.java