/** * <p> * For the metric that the CloudWatch alarm is associated with, a complex type that contains information about the * dimensions for the metric. For information, see <a * href="http://docs.aws.amazon.com/AmazonCloudWatch/latest/DeveloperGuide/CW_Support_For_AWS.html">Amazon * CloudWatch Namespaces, Dimensions, and Metrics Reference</a> in the <i>Amazon CloudWatch User Guide</i>. * </p> * * @param dimensions * For the metric that the CloudWatch alarm is associated with, a complex type that contains information * about the dimensions for the metric. For information, see <a * href="http://docs.aws.amazon.com/AmazonCloudWatch/latest/DeveloperGuide/CW_Support_For_AWS.html">Amazon * CloudWatch Namespaces, Dimensions, and Metrics Reference</a> in the <i>Amazon CloudWatch User Guide</i>. * @return Returns a reference to this object so that method calls can be chained together. */ public CloudWatchAlarmConfiguration withDimensions(java.util.Collection<Dimension> dimensions) { setDimensions(dimensions); return this; }
/** * <p> * For the metric that the CloudWatch alarm is associated with, a complex type that contains information about the * dimensions for the metric. For information, see <a * href="http://docs.aws.amazon.com/AmazonCloudWatch/latest/DeveloperGuide/CW_Support_For_AWS.html">Amazon * CloudWatch Namespaces, Dimensions, and Metrics Reference</a> in the <i>Amazon CloudWatch User Guide</i>. * </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 * For the metric that the CloudWatch alarm is associated with, a complex type that contains information * about the dimensions for the metric. For information, see <a * href="http://docs.aws.amazon.com/AmazonCloudWatch/latest/DeveloperGuide/CW_Support_For_AWS.html">Amazon * CloudWatch Namespaces, Dimensions, and Metrics Reference</a> in the <i>Amazon CloudWatch User Guide</i>. * @return Returns a reference to this object so that method calls can be chained together. */ public CloudWatchAlarmConfiguration withDimensions(Dimension... dimensions) { if (this.dimensions == null) { setDimensions(new com.amazonaws.internal.SdkInternalList<Dimension>(dimensions.length)); } for (Dimension ele : dimensions) { this.dimensions.add(ele); } return this; }