public NetworkPathComponentDetails withPortRanges(PortRange... portRanges) {
        if (this.portRanges == null) {
            setPortRanges(new java.util.ArrayList<PortRange>(portRanges.length));
        }
        for (PortRange ele : portRanges) {
            this.portRanges.add(ele);
        }
        return this;
    }
<p>
A list of port ranges for the destination.
</p>
<p>
<b>NOTE:</b> This method appends the values to the existing list (if any). Use
{@link #setPortRanges(java.util.Collection)} or {@link #withPortRanges(java.util.Collection)} if you want to
override the existing values.
</p>

@param portRanges
       A list of port ranges for the destination.
@return Returns a reference to this object so that method calls can be chained together.
aws-java-sdk-securityhub/src/main/java/com/amazonaws/services/securityhub/model/NetworkPathComponentDetails.java