public DescribeLocationsResult withLocations(Location... locations) {
        if (this.locations == null) {
            setLocations(new com.amazonaws.internal.SdkInternalList<Location>(locations.length));
        }
        for (Location ele : locations) {
            this.locations.add(ele);
        }
        return this;
    }
<p>
The locations.
</p>
<p>
<b>NOTE:</b> This method appends the values to the existing list (if any). Use
{@link #setLocations(java.util.Collection)} or {@link #withLocations(java.util.Collection)} if you want to
override the existing values.
</p>

@param locations
       The locations.
@return Returns a reference to this object so that method calls can be chained together.
aws-java-sdk-directconnect/src/main/java/com/amazonaws/services/directconnect/model/DescribeLocationsResult.java