public Service withDeployments(Deployment... deployments) {
        if (this.deployments == null) {
            setDeployments(new com.amazonaws.internal.SdkInternalList<Deployment>(deployments.length));
        }
        for (Deployment ele : deployments) {
            this.deployments.add(ele);
        }
        return this;
    }
<p>
The current state of deployments for the service.
</p>
<p>
<b>NOTE:</b> This method appends the values to the existing list (if any). Use
{@link #setDeployments(java.util.Collection)} or {@link #withDeployments(java.util.Collection)} if you want to
override the existing values.
</p>

@param deployments
       The current state of deployments for the service.
@return Returns a reference to this object so that method calls can be chained together.
aws-java-sdk-ecs/src/main/java/com/amazonaws/services/ecs/model/Service.java