public Task withAttachments(Attachment... attachments) {
        if (this.attachments == null) {
            setAttachments(new com.amazonaws.internal.SdkInternalList<Attachment>(attachments.length));
        }
        for (Attachment ele : attachments) {
            this.attachments.add(ele);
        }
        return this;
    }
<p>
The Elastic Network Adapter that's associated with the task if the task uses the <code>awsvpc</code> network
mode.
</p>
<p>
<b>NOTE:</b> This method appends the values to the existing list (if any). Use
{@link #setAttachments(java.util.Collection)} or {@link #withAttachments(java.util.Collection)} if you want to
override the existing values.
</p>

@param attachments
       The Elastic Network Adapter that's associated with the task if the task uses the <code>awsvpc</code>
       network mode.
@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/Task.java