public CreateEventSubscriptionRequest withEventCategories(String... eventCategories) {
        if (this.eventCategories == null) {
            setEventCategories(new java.util.ArrayList<String>(eventCategories.length));
        }
        for (String ele : eventCategories) {
            this.eventCategories.add(ele);
        }
        return this;
    }
<p>
A list of event categories for a <code>SourceType</code> that you want to subscribe to.
</p>
<p>
<b>NOTE:</b> This method appends the values to the existing list (if any). Use
{@link #setEventCategories(java.util.Collection)} or {@link #withEventCategories(java.util.Collection)} if you
want to override the existing values.
</p>

@param eventCategories
       A list of event categories for a <code>SourceType</code> that you want to subscribe to.
@return Returns a reference to this object so that method calls can be chained together.
aws-java-sdk-docdb/src/main/java/com/amazonaws/services/docdb/model/CreateEventSubscriptionRequest.java