public MetricStat withMetric(Metric metric) {
        setMetric(metric);
        return this;
    }
<p>
The CloudWatch metric to return, including the metric name, namespace, and dimensions. To get the exact metric
name, namespace, and dimensions, inspect the <a
href="https://docs.aws.amazon.com/AmazonCloudWatch/latest/APIReference/API_Metric.html">Metric</a> object that is
returned by a call to <a
href="https://docs.aws.amazon.com/AmazonCloudWatch/latest/APIReference/API_ListMetrics.html">ListMetrics</a>.
</p>

@param metric
       The CloudWatch metric to return, including the metric name, namespace, and dimensions. To get the exact
       metric name, namespace, and dimensions, inspect the <a
       href="https://docs.aws.amazon.com/AmazonCloudWatch/latest/APIReference/API_Metric.html">Metric</a> object
       that is returned by a call to <a
       href="https://docs.aws.amazon.com/AmazonCloudWatch/latest/APIReference/API_ListMetrics.html"
       >ListMetrics</a>.
@return Returns a reference to this object so that method calls can be chained together.
aws-java-sdk-autoscaling/src/main/java/com/amazonaws/services/autoscaling/model/MetricStat.java