public Metric withDimensions(Dimension... dimensions) {
        if (this.dimensions == null) {
            setDimensions(new java.util.ArrayList<Dimension>(dimensions.length));
        }
        for (Dimension ele : dimensions) {
            this.dimensions.add(ele);
        }
        return this;
    }
<p>
An array of one or more dimensions to use to define the metric that you want to use. For more information, see <a
href
="https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/cloudwatch_concepts.html#Dimension">Dimensions
</a>.
</p>
<p>
<b>NOTE:</b> This method appends the values to the existing list (if any). Use
{@link #setDimensions(java.util.Collection)} or {@link #withDimensions(java.util.Collection)} if you want to
override the existing values.
</p>

@param dimensions
       An array of one or more dimensions to use to define the metric that you want to use. For more information,
       see <a
       href="https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/cloudwatch_concepts.html#Dimension"
       >Dimensions</a>.
@return Returns a reference to this object so that method calls can be chained together.
aws-java-sdk-applicationsignals/src/main/java/com/amazonaws/services/applicationsignals/model/Metric.java