public ListApplicationsRequest withStates(ApplicationState... states) {
        java.util.ArrayList<String> statesCopy = new java.util.ArrayList<String>(states.length);
        for (ApplicationState value : states) {
            statesCopy.add(value.toString());
        }
        if (getStates() == null) {
            setStates(statesCopy);
        } else {
            getStates().addAll(statesCopy);
        }
        return this;
    }
<p>
An optional filter for application states. Note that if this filter contains multiple states, the resulting list
will be grouped by the state.
</p>

@param states
       An optional filter for application states. Note that if this filter contains multiple states, the
       resulting list will be grouped by the state.
@return Returns a reference to this object so that method calls can be chained together.
@see ApplicationState
aws-java-sdk-emrserverless/src/main/java/com/amazonaws/services/emrserverless/model/ListApplicationsRequest.java