com.amazonaws.services.cloudwatch.model.MetricAlarm Maven / Gradle / Ivy
Show all versions of aws-java-sdk-cloudwatch Show documentation
/*
* Copyright 2019-2024 Amazon.com, Inc. or its affiliates. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance with
* the License. A copy of the License is located at
*
* http://aws.amazon.com/apache2.0
*
* or in the "license" file accompanying this file. This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
* CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions
* and limitations under the License.
*/
package com.amazonaws.services.cloudwatch.model;
import java.io.Serializable;
import javax.annotation.Generated;
/**
*
* The details about a metric alarm.
*
*
* @see AWS API
* Documentation
*/
@Generated("com.amazonaws:aws-java-sdk-code-generator")
public class MetricAlarm implements Serializable, Cloneable {
/**
*
* The name of the alarm.
*
*/
private String alarmName;
/**
*
* The Amazon Resource Name (ARN) of the alarm.
*
*/
private String alarmArn;
/**
*
* The description of the alarm.
*
*/
private String alarmDescription;
/**
*
* The time stamp of the last update to the alarm configuration.
*
*/
private java.util.Date alarmConfigurationUpdatedTimestamp;
/**
*
* Indicates whether actions should be executed during any changes to the alarm state.
*
*/
private Boolean actionsEnabled;
/**
*
* The actions to execute when this alarm transitions to the OK
state from any other state. Each action
* is specified as an Amazon Resource Name (ARN).
*
*/
private com.amazonaws.internal.SdkInternalList oKActions;
/**
*
* The actions to execute when this alarm transitions to the ALARM
state from any other state. Each
* action is specified as an Amazon Resource Name (ARN).
*
*/
private com.amazonaws.internal.SdkInternalList alarmActions;
/**
*
* The actions to execute when this alarm transitions to the INSUFFICIENT_DATA
state from any other
* state. Each action is specified as an Amazon Resource Name (ARN).
*
*/
private com.amazonaws.internal.SdkInternalList insufficientDataActions;
/**
*
* The state value for the alarm.
*
*/
private String stateValue;
/**
*
* An explanation for the alarm state, in text format.
*
*/
private String stateReason;
/**
*
* An explanation for the alarm state, in JSON format.
*
*/
private String stateReasonData;
/**
*
* The time stamp of the last update to the value of either the StateValue
or
* EvaluationState
parameters.
*
*/
private java.util.Date stateUpdatedTimestamp;
/**
*
* The name of the metric associated with the alarm, if this is an alarm based on a single metric.
*
*/
private String metricName;
/**
*
* The namespace of the metric associated with the alarm.
*
*/
private String namespace;
/**
*
* The statistic for the metric associated with the alarm, other than percentile. For percentile statistics, use
* ExtendedStatistic
.
*
*/
private String statistic;
/**
*
* The percentile statistic for the metric associated with the alarm. Specify a value between p0.0 and p100.
*
*/
private String extendedStatistic;
/**
*
* The dimensions for the metric associated with the alarm.
*
*/
private com.amazonaws.internal.SdkInternalList dimensions;
/**
*
* The period, in seconds, over which the statistic is applied.
*
*/
private Integer period;
/**
*
* The unit of the metric associated with the alarm.
*
*/
private String unit;
/**
*
* The number of periods over which data is compared to the specified threshold.
*
*/
private Integer evaluationPeriods;
/**
*
* The number of data points that must be breaching to trigger the alarm.
*
*/
private Integer datapointsToAlarm;
/**
*
* The value to compare with the specified statistic.
*
*/
private Double threshold;
/**
*
* The arithmetic operation to use when comparing the specified statistic and threshold. The specified statistic
* value is used as the first operand.
*
*/
private String comparisonOperator;
/**
*
* Sets how this alarm is to handle missing data points. The valid values are breaching
,
* notBreaching
, ignore
, and missing
. For more information, see Configuring how CloudWatch alarms treat missing data.
*
*
* If this parameter is omitted, the default behavior of missing
is used.
*
*/
private String treatMissingData;
/**
*
* Used only for alarms based on percentiles. If ignore
, the alarm state does not change during periods
* with too few data points to be statistically significant. If evaluate
or this parameter is not used,
* the alarm is always evaluated and possibly changes state no matter how many data points are available.
*
*/
private String evaluateLowSampleCountPercentile;
/**
*
* An array of MetricDataQuery structures, used in an alarm based on a metric math expression. Each structure either
* retrieves a metric or performs a math expression. One item in the Metrics array is the math expression that the
* alarm watches. This expression by designated by having ReturnData
set to true.
*
*/
private com.amazonaws.internal.SdkInternalList metrics;
/**
*
* In an alarm based on an anomaly detection model, this is the ID of the ANOMALY_DETECTION_BAND
* function used as the threshold for the alarm.
*
*/
private String thresholdMetricId;
/**
*
* If the value of this field is PARTIAL_DATA
, the alarm is being evaluated based on only partial data.
* This happens if the query used for the alarm returns more than 10,000 metrics. For more information, see Create
* alarms on Metrics Insights queries.
*
*/
private String evaluationState;
/**
*
* The date and time that the alarm's StateValue
most recently changed.
*
*/
private java.util.Date stateTransitionedTimestamp;
/**
*
* The name of the alarm.
*
*
* @param alarmName
* The name of the alarm.
*/
public void setAlarmName(String alarmName) {
this.alarmName = alarmName;
}
/**
*
* The name of the alarm.
*
*
* @return The name of the alarm.
*/
public String getAlarmName() {
return this.alarmName;
}
/**
*
* The name of the alarm.
*
*
* @param alarmName
* The name of the alarm.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public MetricAlarm withAlarmName(String alarmName) {
setAlarmName(alarmName);
return this;
}
/**
*
* The Amazon Resource Name (ARN) of the alarm.
*
*
* @param alarmArn
* The Amazon Resource Name (ARN) of the alarm.
*/
public void setAlarmArn(String alarmArn) {
this.alarmArn = alarmArn;
}
/**
*
* The Amazon Resource Name (ARN) of the alarm.
*
*
* @return The Amazon Resource Name (ARN) of the alarm.
*/
public String getAlarmArn() {
return this.alarmArn;
}
/**
*
* The Amazon Resource Name (ARN) of the alarm.
*
*
* @param alarmArn
* The Amazon Resource Name (ARN) of the alarm.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public MetricAlarm withAlarmArn(String alarmArn) {
setAlarmArn(alarmArn);
return this;
}
/**
*
* The description of the alarm.
*
*
* @param alarmDescription
* The description of the alarm.
*/
public void setAlarmDescription(String alarmDescription) {
this.alarmDescription = alarmDescription;
}
/**
*
* The description of the alarm.
*
*
* @return The description of the alarm.
*/
public String getAlarmDescription() {
return this.alarmDescription;
}
/**
*
* The description of the alarm.
*
*
* @param alarmDescription
* The description of the alarm.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public MetricAlarm withAlarmDescription(String alarmDescription) {
setAlarmDescription(alarmDescription);
return this;
}
/**
*
* The time stamp of the last update to the alarm configuration.
*
*
* @param alarmConfigurationUpdatedTimestamp
* The time stamp of the last update to the alarm configuration.
*/
public void setAlarmConfigurationUpdatedTimestamp(java.util.Date alarmConfigurationUpdatedTimestamp) {
this.alarmConfigurationUpdatedTimestamp = alarmConfigurationUpdatedTimestamp;
}
/**
*
* The time stamp of the last update to the alarm configuration.
*
*
* @return The time stamp of the last update to the alarm configuration.
*/
public java.util.Date getAlarmConfigurationUpdatedTimestamp() {
return this.alarmConfigurationUpdatedTimestamp;
}
/**
*
* The time stamp of the last update to the alarm configuration.
*
*
* @param alarmConfigurationUpdatedTimestamp
* The time stamp of the last update to the alarm configuration.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public MetricAlarm withAlarmConfigurationUpdatedTimestamp(java.util.Date alarmConfigurationUpdatedTimestamp) {
setAlarmConfigurationUpdatedTimestamp(alarmConfigurationUpdatedTimestamp);
return this;
}
/**
*
* Indicates whether actions should be executed during any changes to the alarm state.
*
*
* @param actionsEnabled
* Indicates whether actions should be executed during any changes to the alarm state.
*/
public void setActionsEnabled(Boolean actionsEnabled) {
this.actionsEnabled = actionsEnabled;
}
/**
*
* Indicates whether actions should be executed during any changes to the alarm state.
*
*
* @return Indicates whether actions should be executed during any changes to the alarm state.
*/
public Boolean getActionsEnabled() {
return this.actionsEnabled;
}
/**
*
* Indicates whether actions should be executed during any changes to the alarm state.
*
*
* @param actionsEnabled
* Indicates whether actions should be executed during any changes to the alarm state.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public MetricAlarm withActionsEnabled(Boolean actionsEnabled) {
setActionsEnabled(actionsEnabled);
return this;
}
/**
*
* Indicates whether actions should be executed during any changes to the alarm state.
*
*
* @return Indicates whether actions should be executed during any changes to the alarm state.
*/
public Boolean isActionsEnabled() {
return this.actionsEnabled;
}
/**
*
* The actions to execute when this alarm transitions to the OK
state from any other state. Each action
* is specified as an Amazon Resource Name (ARN).
*
*
* @return The actions to execute when this alarm transitions to the OK
state from any other state.
* Each action is specified as an Amazon Resource Name (ARN).
*/
public java.util.List getOKActions() {
if (oKActions == null) {
oKActions = new com.amazonaws.internal.SdkInternalList();
}
return oKActions;
}
/**
*
* The actions to execute when this alarm transitions to the OK
state from any other state. Each action
* is specified as an Amazon Resource Name (ARN).
*
*
* @param oKActions
* The actions to execute when this alarm transitions to the OK
state from any other state. Each
* action is specified as an Amazon Resource Name (ARN).
*/
public void setOKActions(java.util.Collection oKActions) {
if (oKActions == null) {
this.oKActions = null;
return;
}
this.oKActions = new com.amazonaws.internal.SdkInternalList(oKActions);
}
/**
*
* The actions to execute when this alarm transitions to the OK
state from any other state. Each action
* is specified as an Amazon Resource Name (ARN).
*
*
* NOTE: This method appends the values to the existing list (if any). Use
* {@link #setOKActions(java.util.Collection)} or {@link #withOKActions(java.util.Collection)} if you want to
* override the existing values.
*
*
* @param oKActions
* The actions to execute when this alarm transitions to the OK
state from any other state. Each
* action is specified as an Amazon Resource Name (ARN).
* @return Returns a reference to this object so that method calls can be chained together.
*/
public MetricAlarm withOKActions(String... oKActions) {
if (this.oKActions == null) {
setOKActions(new com.amazonaws.internal.SdkInternalList(oKActions.length));
}
for (String ele : oKActions) {
this.oKActions.add(ele);
}
return this;
}
/**
*
* The actions to execute when this alarm transitions to the OK
state from any other state. Each action
* is specified as an Amazon Resource Name (ARN).
*
*
* @param oKActions
* The actions to execute when this alarm transitions to the OK
state from any other state. Each
* action is specified as an Amazon Resource Name (ARN).
* @return Returns a reference to this object so that method calls can be chained together.
*/
public MetricAlarm withOKActions(java.util.Collection oKActions) {
setOKActions(oKActions);
return this;
}
/**
*
* The actions to execute when this alarm transitions to the ALARM
state from any other state. Each
* action is specified as an Amazon Resource Name (ARN).
*
*
* @return The actions to execute when this alarm transitions to the ALARM
state from any other state.
* Each action is specified as an Amazon Resource Name (ARN).
*/
public java.util.List getAlarmActions() {
if (alarmActions == null) {
alarmActions = new com.amazonaws.internal.SdkInternalList();
}
return alarmActions;
}
/**
*
* The actions to execute when this alarm transitions to the ALARM
state from any other state. Each
* action is specified as an Amazon Resource Name (ARN).
*
*
* @param alarmActions
* The actions to execute when this alarm transitions to the ALARM
state from any other state.
* Each action is specified as an Amazon Resource Name (ARN).
*/
public void setAlarmActions(java.util.Collection alarmActions) {
if (alarmActions == null) {
this.alarmActions = null;
return;
}
this.alarmActions = new com.amazonaws.internal.SdkInternalList(alarmActions);
}
/**
*
* The actions to execute when this alarm transitions to the ALARM
state from any other state. Each
* action is specified as an Amazon Resource Name (ARN).
*
*
* NOTE: This method appends the values to the existing list (if any). Use
* {@link #setAlarmActions(java.util.Collection)} or {@link #withAlarmActions(java.util.Collection)} if you want to
* override the existing values.
*
*
* @param alarmActions
* The actions to execute when this alarm transitions to the ALARM
state from any other state.
* Each action is specified as an Amazon Resource Name (ARN).
* @return Returns a reference to this object so that method calls can be chained together.
*/
public MetricAlarm withAlarmActions(String... alarmActions) {
if (this.alarmActions == null) {
setAlarmActions(new com.amazonaws.internal.SdkInternalList(alarmActions.length));
}
for (String ele : alarmActions) {
this.alarmActions.add(ele);
}
return this;
}
/**
*
* The actions to execute when this alarm transitions to the ALARM
state from any other state. Each
* action is specified as an Amazon Resource Name (ARN).
*
*
* @param alarmActions
* The actions to execute when this alarm transitions to the ALARM
state from any other state.
* Each action is specified as an Amazon Resource Name (ARN).
* @return Returns a reference to this object so that method calls can be chained together.
*/
public MetricAlarm withAlarmActions(java.util.Collection alarmActions) {
setAlarmActions(alarmActions);
return this;
}
/**
*
* The actions to execute when this alarm transitions to the INSUFFICIENT_DATA
state from any other
* state. Each action is specified as an Amazon Resource Name (ARN).
*
*
* @return The actions to execute when this alarm transitions to the INSUFFICIENT_DATA
state from any
* other state. Each action is specified as an Amazon Resource Name (ARN).
*/
public java.util.List getInsufficientDataActions() {
if (insufficientDataActions == null) {
insufficientDataActions = new com.amazonaws.internal.SdkInternalList();
}
return insufficientDataActions;
}
/**
*
* The actions to execute when this alarm transitions to the INSUFFICIENT_DATA
state from any other
* state. Each action is specified as an Amazon Resource Name (ARN).
*
*
* @param insufficientDataActions
* The actions to execute when this alarm transitions to the INSUFFICIENT_DATA
state from any
* other state. Each action is specified as an Amazon Resource Name (ARN).
*/
public void setInsufficientDataActions(java.util.Collection insufficientDataActions) {
if (insufficientDataActions == null) {
this.insufficientDataActions = null;
return;
}
this.insufficientDataActions = new com.amazonaws.internal.SdkInternalList(insufficientDataActions);
}
/**
*
* The actions to execute when this alarm transitions to the INSUFFICIENT_DATA
state from any other
* state. Each action is specified as an Amazon Resource Name (ARN).
*
*
* NOTE: This method appends the values to the existing list (if any). Use
* {@link #setInsufficientDataActions(java.util.Collection)} or
* {@link #withInsufficientDataActions(java.util.Collection)} if you want to override the existing values.
*
*
* @param insufficientDataActions
* The actions to execute when this alarm transitions to the INSUFFICIENT_DATA
state from any
* other state. Each action is specified as an Amazon Resource Name (ARN).
* @return Returns a reference to this object so that method calls can be chained together.
*/
public MetricAlarm withInsufficientDataActions(String... insufficientDataActions) {
if (this.insufficientDataActions == null) {
setInsufficientDataActions(new com.amazonaws.internal.SdkInternalList(insufficientDataActions.length));
}
for (String ele : insufficientDataActions) {
this.insufficientDataActions.add(ele);
}
return this;
}
/**
*
* The actions to execute when this alarm transitions to the INSUFFICIENT_DATA
state from any other
* state. Each action is specified as an Amazon Resource Name (ARN).
*
*
* @param insufficientDataActions
* The actions to execute when this alarm transitions to the INSUFFICIENT_DATA
state from any
* other state. Each action is specified as an Amazon Resource Name (ARN).
* @return Returns a reference to this object so that method calls can be chained together.
*/
public MetricAlarm withInsufficientDataActions(java.util.Collection insufficientDataActions) {
setInsufficientDataActions(insufficientDataActions);
return this;
}
/**
*
* The state value for the alarm.
*
*
* @param stateValue
* The state value for the alarm.
* @see StateValue
*/
public void setStateValue(String stateValue) {
this.stateValue = stateValue;
}
/**
*
* The state value for the alarm.
*
*
* @return The state value for the alarm.
* @see StateValue
*/
public String getStateValue() {
return this.stateValue;
}
/**
*
* The state value for the alarm.
*
*
* @param stateValue
* The state value for the alarm.
* @return Returns a reference to this object so that method calls can be chained together.
* @see StateValue
*/
public MetricAlarm withStateValue(String stateValue) {
setStateValue(stateValue);
return this;
}
/**
*
* The state value for the alarm.
*
*
* @param stateValue
* The state value for the alarm.
* @see StateValue
*/
public void setStateValue(StateValue stateValue) {
withStateValue(stateValue);
}
/**
*
* The state value for the alarm.
*
*
* @param stateValue
* The state value for the alarm.
* @return Returns a reference to this object so that method calls can be chained together.
* @see StateValue
*/
public MetricAlarm withStateValue(StateValue stateValue) {
this.stateValue = stateValue.toString();
return this;
}
/**
*
* An explanation for the alarm state, in text format.
*
*
* @param stateReason
* An explanation for the alarm state, in text format.
*/
public void setStateReason(String stateReason) {
this.stateReason = stateReason;
}
/**
*
* An explanation for the alarm state, in text format.
*
*
* @return An explanation for the alarm state, in text format.
*/
public String getStateReason() {
return this.stateReason;
}
/**
*
* An explanation for the alarm state, in text format.
*
*
* @param stateReason
* An explanation for the alarm state, in text format.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public MetricAlarm withStateReason(String stateReason) {
setStateReason(stateReason);
return this;
}
/**
*
* An explanation for the alarm state, in JSON format.
*
*
* @param stateReasonData
* An explanation for the alarm state, in JSON format.
*/
public void setStateReasonData(String stateReasonData) {
this.stateReasonData = stateReasonData;
}
/**
*
* An explanation for the alarm state, in JSON format.
*
*
* @return An explanation for the alarm state, in JSON format.
*/
public String getStateReasonData() {
return this.stateReasonData;
}
/**
*
* An explanation for the alarm state, in JSON format.
*
*
* @param stateReasonData
* An explanation for the alarm state, in JSON format.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public MetricAlarm withStateReasonData(String stateReasonData) {
setStateReasonData(stateReasonData);
return this;
}
/**
*
* The time stamp of the last update to the value of either the StateValue
or
* EvaluationState
parameters.
*
*
* @param stateUpdatedTimestamp
* The time stamp of the last update to the value of either the StateValue
or
* EvaluationState
parameters.
*/
public void setStateUpdatedTimestamp(java.util.Date stateUpdatedTimestamp) {
this.stateUpdatedTimestamp = stateUpdatedTimestamp;
}
/**
*
* The time stamp of the last update to the value of either the StateValue
or
* EvaluationState
parameters.
*
*
* @return The time stamp of the last update to the value of either the StateValue
or
* EvaluationState
parameters.
*/
public java.util.Date getStateUpdatedTimestamp() {
return this.stateUpdatedTimestamp;
}
/**
*
* The time stamp of the last update to the value of either the StateValue
or
* EvaluationState
parameters.
*
*
* @param stateUpdatedTimestamp
* The time stamp of the last update to the value of either the StateValue
or
* EvaluationState
parameters.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public MetricAlarm withStateUpdatedTimestamp(java.util.Date stateUpdatedTimestamp) {
setStateUpdatedTimestamp(stateUpdatedTimestamp);
return this;
}
/**
*
* The name of the metric associated with the alarm, if this is an alarm based on a single metric.
*
*
* @param metricName
* The name of the metric associated with the alarm, if this is an alarm based on a single metric.
*/
public void setMetricName(String metricName) {
this.metricName = metricName;
}
/**
*
* The name of the metric associated with the alarm, if this is an alarm based on a single metric.
*
*
* @return The name of the metric associated with the alarm, if this is an alarm based on a single metric.
*/
public String getMetricName() {
return this.metricName;
}
/**
*
* The name of the metric associated with the alarm, if this is an alarm based on a single metric.
*
*
* @param metricName
* The name of the metric associated with the alarm, if this is an alarm based on a single metric.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public MetricAlarm withMetricName(String metricName) {
setMetricName(metricName);
return this;
}
/**
*
* The namespace of the metric associated with the alarm.
*
*
* @param namespace
* The namespace of the metric associated with the alarm.
*/
public void setNamespace(String namespace) {
this.namespace = namespace;
}
/**
*
* The namespace of the metric associated with the alarm.
*
*
* @return The namespace of the metric associated with the alarm.
*/
public String getNamespace() {
return this.namespace;
}
/**
*
* The namespace of the metric associated with the alarm.
*
*
* @param namespace
* The namespace of the metric associated with the alarm.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public MetricAlarm withNamespace(String namespace) {
setNamespace(namespace);
return this;
}
/**
*
* The statistic for the metric associated with the alarm, other than percentile. For percentile statistics, use
* ExtendedStatistic
.
*
*
* @param statistic
* The statistic for the metric associated with the alarm, other than percentile. For percentile statistics,
* use ExtendedStatistic
.
* @see Statistic
*/
public void setStatistic(String statistic) {
this.statistic = statistic;
}
/**
*
* The statistic for the metric associated with the alarm, other than percentile. For percentile statistics, use
* ExtendedStatistic
.
*
*
* @return The statistic for the metric associated with the alarm, other than percentile. For percentile statistics,
* use ExtendedStatistic
.
* @see Statistic
*/
public String getStatistic() {
return this.statistic;
}
/**
*
* The statistic for the metric associated with the alarm, other than percentile. For percentile statistics, use
* ExtendedStatistic
.
*
*
* @param statistic
* The statistic for the metric associated with the alarm, other than percentile. For percentile statistics,
* use ExtendedStatistic
.
* @return Returns a reference to this object so that method calls can be chained together.
* @see Statistic
*/
public MetricAlarm withStatistic(String statistic) {
setStatistic(statistic);
return this;
}
/**
*
* The statistic for the metric associated with the alarm, other than percentile. For percentile statistics, use
* ExtendedStatistic
.
*
*
* @param statistic
* The statistic for the metric associated with the alarm, other than percentile. For percentile statistics,
* use ExtendedStatistic
.
* @see Statistic
*/
public void setStatistic(Statistic statistic) {
withStatistic(statistic);
}
/**
*
* The statistic for the metric associated with the alarm, other than percentile. For percentile statistics, use
* ExtendedStatistic
.
*
*
* @param statistic
* The statistic for the metric associated with the alarm, other than percentile. For percentile statistics,
* use ExtendedStatistic
.
* @return Returns a reference to this object so that method calls can be chained together.
* @see Statistic
*/
public MetricAlarm withStatistic(Statistic statistic) {
this.statistic = statistic.toString();
return this;
}
/**
*
* The percentile statistic for the metric associated with the alarm. Specify a value between p0.0 and p100.
*
*
* @param extendedStatistic
* The percentile statistic for the metric associated with the alarm. Specify a value between p0.0 and p100.
*/
public void setExtendedStatistic(String extendedStatistic) {
this.extendedStatistic = extendedStatistic;
}
/**
*
* The percentile statistic for the metric associated with the alarm. Specify a value between p0.0 and p100.
*
*
* @return The percentile statistic for the metric associated with the alarm. Specify a value between p0.0 and p100.
*/
public String getExtendedStatistic() {
return this.extendedStatistic;
}
/**
*
* The percentile statistic for the metric associated with the alarm. Specify a value between p0.0 and p100.
*
*
* @param extendedStatistic
* The percentile statistic for the metric associated with the alarm. Specify a value between p0.0 and p100.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public MetricAlarm withExtendedStatistic(String extendedStatistic) {
setExtendedStatistic(extendedStatistic);
return this;
}
/**
*
* The dimensions for the metric associated with the alarm.
*
*
* @return The dimensions for the metric associated with the alarm.
*/
public java.util.List getDimensions() {
if (dimensions == null) {
dimensions = new com.amazonaws.internal.SdkInternalList();
}
return dimensions;
}
/**
*
* The dimensions for the metric associated with the alarm.
*
*
* @param dimensions
* The dimensions for the metric associated with the alarm.
*/
public void setDimensions(java.util.Collection dimensions) {
if (dimensions == null) {
this.dimensions = null;
return;
}
this.dimensions = new com.amazonaws.internal.SdkInternalList(dimensions);
}
/**
*
* The dimensions for the metric associated with the alarm.
*
*
* NOTE: 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.
*
*
* @param dimensions
* The dimensions for the metric associated with the alarm.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public MetricAlarm withDimensions(Dimension... dimensions) {
if (this.dimensions == null) {
setDimensions(new com.amazonaws.internal.SdkInternalList(dimensions.length));
}
for (Dimension ele : dimensions) {
this.dimensions.add(ele);
}
return this;
}
/**
*
* The dimensions for the metric associated with the alarm.
*
*
* @param dimensions
* The dimensions for the metric associated with the alarm.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public MetricAlarm withDimensions(java.util.Collection dimensions) {
setDimensions(dimensions);
return this;
}
/**
*
* The period, in seconds, over which the statistic is applied.
*
*
* @param period
* The period, in seconds, over which the statistic is applied.
*/
public void setPeriod(Integer period) {
this.period = period;
}
/**
*
* The period, in seconds, over which the statistic is applied.
*
*
* @return The period, in seconds, over which the statistic is applied.
*/
public Integer getPeriod() {
return this.period;
}
/**
*
* The period, in seconds, over which the statistic is applied.
*
*
* @param period
* The period, in seconds, over which the statistic is applied.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public MetricAlarm withPeriod(Integer period) {
setPeriod(period);
return this;
}
/**
*
* The unit of the metric associated with the alarm.
*
*
* @param unit
* The unit of the metric associated with the alarm.
* @see StandardUnit
*/
public void setUnit(String unit) {
this.unit = unit;
}
/**
*
* The unit of the metric associated with the alarm.
*
*
* @return The unit of the metric associated with the alarm.
* @see StandardUnit
*/
public String getUnit() {
return this.unit;
}
/**
*
* The unit of the metric associated with the alarm.
*
*
* @param unit
* The unit of the metric associated with the alarm.
* @return Returns a reference to this object so that method calls can be chained together.
* @see StandardUnit
*/
public MetricAlarm withUnit(String unit) {
setUnit(unit);
return this;
}
/**
*
* The unit of the metric associated with the alarm.
*
*
* @param unit
* The unit of the metric associated with the alarm.
* @see StandardUnit
*/
public void setUnit(StandardUnit unit) {
withUnit(unit);
}
/**
*
* The unit of the metric associated with the alarm.
*
*
* @param unit
* The unit of the metric associated with the alarm.
* @return Returns a reference to this object so that method calls can be chained together.
* @see StandardUnit
*/
public MetricAlarm withUnit(StandardUnit unit) {
this.unit = unit.toString();
return this;
}
/**
*
* The number of periods over which data is compared to the specified threshold.
*
*
* @param evaluationPeriods
* The number of periods over which data is compared to the specified threshold.
*/
public void setEvaluationPeriods(Integer evaluationPeriods) {
this.evaluationPeriods = evaluationPeriods;
}
/**
*
* The number of periods over which data is compared to the specified threshold.
*
*
* @return The number of periods over which data is compared to the specified threshold.
*/
public Integer getEvaluationPeriods() {
return this.evaluationPeriods;
}
/**
*
* The number of periods over which data is compared to the specified threshold.
*
*
* @param evaluationPeriods
* The number of periods over which data is compared to the specified threshold.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public MetricAlarm withEvaluationPeriods(Integer evaluationPeriods) {
setEvaluationPeriods(evaluationPeriods);
return this;
}
/**
*
* The number of data points that must be breaching to trigger the alarm.
*
*
* @param datapointsToAlarm
* The number of data points that must be breaching to trigger the alarm.
*/
public void setDatapointsToAlarm(Integer datapointsToAlarm) {
this.datapointsToAlarm = datapointsToAlarm;
}
/**
*
* The number of data points that must be breaching to trigger the alarm.
*
*
* @return The number of data points that must be breaching to trigger the alarm.
*/
public Integer getDatapointsToAlarm() {
return this.datapointsToAlarm;
}
/**
*
* The number of data points that must be breaching to trigger the alarm.
*
*
* @param datapointsToAlarm
* The number of data points that must be breaching to trigger the alarm.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public MetricAlarm withDatapointsToAlarm(Integer datapointsToAlarm) {
setDatapointsToAlarm(datapointsToAlarm);
return this;
}
/**
*
* The value to compare with the specified statistic.
*
*
* @param threshold
* The value to compare with the specified statistic.
*/
public void setThreshold(Double threshold) {
this.threshold = threshold;
}
/**
*
* The value to compare with the specified statistic.
*
*
* @return The value to compare with the specified statistic.
*/
public Double getThreshold() {
return this.threshold;
}
/**
*
* The value to compare with the specified statistic.
*
*
* @param threshold
* The value to compare with the specified statistic.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public MetricAlarm withThreshold(Double threshold) {
setThreshold(threshold);
return this;
}
/**
*
* The arithmetic operation to use when comparing the specified statistic and threshold. The specified statistic
* value is used as the first operand.
*
*
* @param comparisonOperator
* The arithmetic operation to use when comparing the specified statistic and threshold. The specified
* statistic value is used as the first operand.
* @see ComparisonOperator
*/
public void setComparisonOperator(String comparisonOperator) {
this.comparisonOperator = comparisonOperator;
}
/**
*
* The arithmetic operation to use when comparing the specified statistic and threshold. The specified statistic
* value is used as the first operand.
*
*
* @return The arithmetic operation to use when comparing the specified statistic and threshold. The specified
* statistic value is used as the first operand.
* @see ComparisonOperator
*/
public String getComparisonOperator() {
return this.comparisonOperator;
}
/**
*
* The arithmetic operation to use when comparing the specified statistic and threshold. The specified statistic
* value is used as the first operand.
*
*
* @param comparisonOperator
* The arithmetic operation to use when comparing the specified statistic and threshold. The specified
* statistic value is used as the first operand.
* @return Returns a reference to this object so that method calls can be chained together.
* @see ComparisonOperator
*/
public MetricAlarm withComparisonOperator(String comparisonOperator) {
setComparisonOperator(comparisonOperator);
return this;
}
/**
*
* The arithmetic operation to use when comparing the specified statistic and threshold. The specified statistic
* value is used as the first operand.
*
*
* @param comparisonOperator
* The arithmetic operation to use when comparing the specified statistic and threshold. The specified
* statistic value is used as the first operand.
* @see ComparisonOperator
*/
public void setComparisonOperator(ComparisonOperator comparisonOperator) {
withComparisonOperator(comparisonOperator);
}
/**
*
* The arithmetic operation to use when comparing the specified statistic and threshold. The specified statistic
* value is used as the first operand.
*
*
* @param comparisonOperator
* The arithmetic operation to use when comparing the specified statistic and threshold. The specified
* statistic value is used as the first operand.
* @return Returns a reference to this object so that method calls can be chained together.
* @see ComparisonOperator
*/
public MetricAlarm withComparisonOperator(ComparisonOperator comparisonOperator) {
this.comparisonOperator = comparisonOperator.toString();
return this;
}
/**
*
* Sets how this alarm is to handle missing data points. The valid values are breaching
,
* notBreaching
, ignore
, and missing
. For more information, see Configuring how CloudWatch alarms treat missing data.
*
*
* If this parameter is omitted, the default behavior of missing
is used.
*
*
* @param treatMissingData
* Sets how this alarm is to handle missing data points. The valid values are breaching
,
* notBreaching
, ignore
, and missing
. For more information, see Configuring how CloudWatch alarms treat missing data.
*
* If this parameter is omitted, the default behavior of missing
is used.
*/
public void setTreatMissingData(String treatMissingData) {
this.treatMissingData = treatMissingData;
}
/**
*
* Sets how this alarm is to handle missing data points. The valid values are breaching
,
* notBreaching
, ignore
, and missing
. For more information, see Configuring how CloudWatch alarms treat missing data.
*
*
* If this parameter is omitted, the default behavior of missing
is used.
*
*
* @return Sets how this alarm is to handle missing data points. The valid values are breaching
,
* notBreaching
, ignore
, and missing
. For more information, see Configuring how CloudWatch alarms treat missing data.
*
* If this parameter is omitted, the default behavior of missing
is used.
*/
public String getTreatMissingData() {
return this.treatMissingData;
}
/**
*
* Sets how this alarm is to handle missing data points. The valid values are breaching
,
* notBreaching
, ignore
, and missing
. For more information, see Configuring how CloudWatch alarms treat missing data.
*
*
* If this parameter is omitted, the default behavior of missing
is used.
*
*
* @param treatMissingData
* Sets how this alarm is to handle missing data points. The valid values are breaching
,
* notBreaching
, ignore
, and missing
. For more information, see Configuring how CloudWatch alarms treat missing data.
*
* If this parameter is omitted, the default behavior of missing
is used.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public MetricAlarm withTreatMissingData(String treatMissingData) {
setTreatMissingData(treatMissingData);
return this;
}
/**
*
* Used only for alarms based on percentiles. If ignore
, the alarm state does not change during periods
* with too few data points to be statistically significant. If evaluate
or this parameter is not used,
* the alarm is always evaluated and possibly changes state no matter how many data points are available.
*
*
* @param evaluateLowSampleCountPercentile
* Used only for alarms based on percentiles. If ignore
, the alarm state does not change during
* periods with too few data points to be statistically significant. If evaluate
or this
* parameter is not used, the alarm is always evaluated and possibly changes state no matter how many data
* points are available.
*/
public void setEvaluateLowSampleCountPercentile(String evaluateLowSampleCountPercentile) {
this.evaluateLowSampleCountPercentile = evaluateLowSampleCountPercentile;
}
/**
*
* Used only for alarms based on percentiles. If ignore
, the alarm state does not change during periods
* with too few data points to be statistically significant. If evaluate
or this parameter is not used,
* the alarm is always evaluated and possibly changes state no matter how many data points are available.
*
*
* @return Used only for alarms based on percentiles. If ignore
, the alarm state does not change during
* periods with too few data points to be statistically significant. If evaluate
or this
* parameter is not used, the alarm is always evaluated and possibly changes state no matter how many data
* points are available.
*/
public String getEvaluateLowSampleCountPercentile() {
return this.evaluateLowSampleCountPercentile;
}
/**
*
* Used only for alarms based on percentiles. If ignore
, the alarm state does not change during periods
* with too few data points to be statistically significant. If evaluate
or this parameter is not used,
* the alarm is always evaluated and possibly changes state no matter how many data points are available.
*
*
* @param evaluateLowSampleCountPercentile
* Used only for alarms based on percentiles. If ignore
, the alarm state does not change during
* periods with too few data points to be statistically significant. If evaluate
or this
* parameter is not used, the alarm is always evaluated and possibly changes state no matter how many data
* points are available.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public MetricAlarm withEvaluateLowSampleCountPercentile(String evaluateLowSampleCountPercentile) {
setEvaluateLowSampleCountPercentile(evaluateLowSampleCountPercentile);
return this;
}
/**
*
* An array of MetricDataQuery structures, used in an alarm based on a metric math expression. Each structure either
* retrieves a metric or performs a math expression. One item in the Metrics array is the math expression that the
* alarm watches. This expression by designated by having ReturnData
set to true.
*
*
* @return An array of MetricDataQuery structures, used in an alarm based on a metric math expression. Each
* structure either retrieves a metric or performs a math expression. One item in the Metrics array is the
* math expression that the alarm watches. This expression by designated by having ReturnData
* set to true.
*/
public java.util.List getMetrics() {
if (metrics == null) {
metrics = new com.amazonaws.internal.SdkInternalList();
}
return metrics;
}
/**
*
* An array of MetricDataQuery structures, used in an alarm based on a metric math expression. Each structure either
* retrieves a metric or performs a math expression. One item in the Metrics array is the math expression that the
* alarm watches. This expression by designated by having ReturnData
set to true.
*
*
* @param metrics
* An array of MetricDataQuery structures, used in an alarm based on a metric math expression. Each structure
* either retrieves a metric or performs a math expression. One item in the Metrics array is the math
* expression that the alarm watches. This expression by designated by having ReturnData
set to
* true.
*/
public void setMetrics(java.util.Collection metrics) {
if (metrics == null) {
this.metrics = null;
return;
}
this.metrics = new com.amazonaws.internal.SdkInternalList(metrics);
}
/**
*
* An array of MetricDataQuery structures, used in an alarm based on a metric math expression. Each structure either
* retrieves a metric or performs a math expression. One item in the Metrics array is the math expression that the
* alarm watches. This expression by designated by having ReturnData
set to true.
*
*
* NOTE: This method appends the values to the existing list (if any). Use
* {@link #setMetrics(java.util.Collection)} or {@link #withMetrics(java.util.Collection)} if you want to override
* the existing values.
*
*
* @param metrics
* An array of MetricDataQuery structures, used in an alarm based on a metric math expression. Each structure
* either retrieves a metric or performs a math expression. One item in the Metrics array is the math
* expression that the alarm watches. This expression by designated by having ReturnData
set to
* true.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public MetricAlarm withMetrics(MetricDataQuery... metrics) {
if (this.metrics == null) {
setMetrics(new com.amazonaws.internal.SdkInternalList(metrics.length));
}
for (MetricDataQuery ele : metrics) {
this.metrics.add(ele);
}
return this;
}
/**
*
* An array of MetricDataQuery structures, used in an alarm based on a metric math expression. Each structure either
* retrieves a metric or performs a math expression. One item in the Metrics array is the math expression that the
* alarm watches. This expression by designated by having ReturnData
set to true.
*
*
* @param metrics
* An array of MetricDataQuery structures, used in an alarm based on a metric math expression. Each structure
* either retrieves a metric or performs a math expression. One item in the Metrics array is the math
* expression that the alarm watches. This expression by designated by having ReturnData
set to
* true.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public MetricAlarm withMetrics(java.util.Collection metrics) {
setMetrics(metrics);
return this;
}
/**
*
* In an alarm based on an anomaly detection model, this is the ID of the ANOMALY_DETECTION_BAND
* function used as the threshold for the alarm.
*
*
* @param thresholdMetricId
* In an alarm based on an anomaly detection model, this is the ID of the ANOMALY_DETECTION_BAND
* function used as the threshold for the alarm.
*/
public void setThresholdMetricId(String thresholdMetricId) {
this.thresholdMetricId = thresholdMetricId;
}
/**
*
* In an alarm based on an anomaly detection model, this is the ID of the ANOMALY_DETECTION_BAND
* function used as the threshold for the alarm.
*
*
* @return In an alarm based on an anomaly detection model, this is the ID of the
* ANOMALY_DETECTION_BAND
function used as the threshold for the alarm.
*/
public String getThresholdMetricId() {
return this.thresholdMetricId;
}
/**
*
* In an alarm based on an anomaly detection model, this is the ID of the ANOMALY_DETECTION_BAND
* function used as the threshold for the alarm.
*
*
* @param thresholdMetricId
* In an alarm based on an anomaly detection model, this is the ID of the ANOMALY_DETECTION_BAND
* function used as the threshold for the alarm.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public MetricAlarm withThresholdMetricId(String thresholdMetricId) {
setThresholdMetricId(thresholdMetricId);
return this;
}
/**
*
* If the value of this field is PARTIAL_DATA
, the alarm is being evaluated based on only partial data.
* This happens if the query used for the alarm returns more than 10,000 metrics. For more information, see Create
* alarms on Metrics Insights queries.
*
*
* @param evaluationState
* If the value of this field is PARTIAL_DATA
, the alarm is being evaluated based on only
* partial data. This happens if the query used for the alarm returns more than 10,000 metrics. For more
* information, see Create alarms on Metrics Insights queries.
* @see EvaluationState
*/
public void setEvaluationState(String evaluationState) {
this.evaluationState = evaluationState;
}
/**
*
* If the value of this field is PARTIAL_DATA
, the alarm is being evaluated based on only partial data.
* This happens if the query used for the alarm returns more than 10,000 metrics. For more information, see Create
* alarms on Metrics Insights queries.
*
*
* @return If the value of this field is PARTIAL_DATA
, the alarm is being evaluated based on only
* partial data. This happens if the query used for the alarm returns more than 10,000 metrics. For more
* information, see Create alarms on Metrics Insights queries.
* @see EvaluationState
*/
public String getEvaluationState() {
return this.evaluationState;
}
/**
*
* If the value of this field is PARTIAL_DATA
, the alarm is being evaluated based on only partial data.
* This happens if the query used for the alarm returns more than 10,000 metrics. For more information, see Create
* alarms on Metrics Insights queries.
*
*
* @param evaluationState
* If the value of this field is PARTIAL_DATA
, the alarm is being evaluated based on only
* partial data. This happens if the query used for the alarm returns more than 10,000 metrics. For more
* information, see Create alarms on Metrics Insights queries.
* @return Returns a reference to this object so that method calls can be chained together.
* @see EvaluationState
*/
public MetricAlarm withEvaluationState(String evaluationState) {
setEvaluationState(evaluationState);
return this;
}
/**
*
* If the value of this field is PARTIAL_DATA
, the alarm is being evaluated based on only partial data.
* This happens if the query used for the alarm returns more than 10,000 metrics. For more information, see Create
* alarms on Metrics Insights queries.
*
*
* @param evaluationState
* If the value of this field is PARTIAL_DATA
, the alarm is being evaluated based on only
* partial data. This happens if the query used for the alarm returns more than 10,000 metrics. For more
* information, see Create alarms on Metrics Insights queries.
* @see EvaluationState
*/
public void setEvaluationState(EvaluationState evaluationState) {
withEvaluationState(evaluationState);
}
/**
*
* If the value of this field is PARTIAL_DATA
, the alarm is being evaluated based on only partial data.
* This happens if the query used for the alarm returns more than 10,000 metrics. For more information, see Create
* alarms on Metrics Insights queries.
*
*
* @param evaluationState
* If the value of this field is PARTIAL_DATA
, the alarm is being evaluated based on only
* partial data. This happens if the query used for the alarm returns more than 10,000 metrics. For more
* information, see Create alarms on Metrics Insights queries.
* @return Returns a reference to this object so that method calls can be chained together.
* @see EvaluationState
*/
public MetricAlarm withEvaluationState(EvaluationState evaluationState) {
this.evaluationState = evaluationState.toString();
return this;
}
/**
*
* The date and time that the alarm's StateValue
most recently changed.
*
*
* @param stateTransitionedTimestamp
* The date and time that the alarm's StateValue
most recently changed.
*/
public void setStateTransitionedTimestamp(java.util.Date stateTransitionedTimestamp) {
this.stateTransitionedTimestamp = stateTransitionedTimestamp;
}
/**
*
* The date and time that the alarm's StateValue
most recently changed.
*
*
* @return The date and time that the alarm's StateValue
most recently changed.
*/
public java.util.Date getStateTransitionedTimestamp() {
return this.stateTransitionedTimestamp;
}
/**
*
* The date and time that the alarm's StateValue
most recently changed.
*
*
* @param stateTransitionedTimestamp
* The date and time that the alarm's StateValue
most recently changed.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public MetricAlarm withStateTransitionedTimestamp(java.util.Date stateTransitionedTimestamp) {
setStateTransitionedTimestamp(stateTransitionedTimestamp);
return this;
}
/**
* Returns a string representation of this object. This is useful for testing and debugging. Sensitive data will be
* redacted from this string using a placeholder value.
*
* @return A string representation of this object.
*
* @see java.lang.Object#toString()
*/
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("{");
if (getAlarmName() != null)
sb.append("AlarmName: ").append(getAlarmName()).append(",");
if (getAlarmArn() != null)
sb.append("AlarmArn: ").append(getAlarmArn()).append(",");
if (getAlarmDescription() != null)
sb.append("AlarmDescription: ").append(getAlarmDescription()).append(",");
if (getAlarmConfigurationUpdatedTimestamp() != null)
sb.append("AlarmConfigurationUpdatedTimestamp: ").append(getAlarmConfigurationUpdatedTimestamp()).append(",");
if (getActionsEnabled() != null)
sb.append("ActionsEnabled: ").append(getActionsEnabled()).append(",");
if (getOKActions() != null)
sb.append("OKActions: ").append(getOKActions()).append(",");
if (getAlarmActions() != null)
sb.append("AlarmActions: ").append(getAlarmActions()).append(",");
if (getInsufficientDataActions() != null)
sb.append("InsufficientDataActions: ").append(getInsufficientDataActions()).append(",");
if (getStateValue() != null)
sb.append("StateValue: ").append(getStateValue()).append(",");
if (getStateReason() != null)
sb.append("StateReason: ").append(getStateReason()).append(",");
if (getStateReasonData() != null)
sb.append("StateReasonData: ").append(getStateReasonData()).append(",");
if (getStateUpdatedTimestamp() != null)
sb.append("StateUpdatedTimestamp: ").append(getStateUpdatedTimestamp()).append(",");
if (getMetricName() != null)
sb.append("MetricName: ").append(getMetricName()).append(",");
if (getNamespace() != null)
sb.append("Namespace: ").append(getNamespace()).append(",");
if (getStatistic() != null)
sb.append("Statistic: ").append(getStatistic()).append(",");
if (getExtendedStatistic() != null)
sb.append("ExtendedStatistic: ").append(getExtendedStatistic()).append(",");
if (getDimensions() != null)
sb.append("Dimensions: ").append(getDimensions()).append(",");
if (getPeriod() != null)
sb.append("Period: ").append(getPeriod()).append(",");
if (getUnit() != null)
sb.append("Unit: ").append(getUnit()).append(",");
if (getEvaluationPeriods() != null)
sb.append("EvaluationPeriods: ").append(getEvaluationPeriods()).append(",");
if (getDatapointsToAlarm() != null)
sb.append("DatapointsToAlarm: ").append(getDatapointsToAlarm()).append(",");
if (getThreshold() != null)
sb.append("Threshold: ").append(getThreshold()).append(",");
if (getComparisonOperator() != null)
sb.append("ComparisonOperator: ").append(getComparisonOperator()).append(",");
if (getTreatMissingData() != null)
sb.append("TreatMissingData: ").append(getTreatMissingData()).append(",");
if (getEvaluateLowSampleCountPercentile() != null)
sb.append("EvaluateLowSampleCountPercentile: ").append(getEvaluateLowSampleCountPercentile()).append(",");
if (getMetrics() != null)
sb.append("Metrics: ").append(getMetrics()).append(",");
if (getThresholdMetricId() != null)
sb.append("ThresholdMetricId: ").append(getThresholdMetricId()).append(",");
if (getEvaluationState() != null)
sb.append("EvaluationState: ").append(getEvaluationState()).append(",");
if (getStateTransitionedTimestamp() != null)
sb.append("StateTransitionedTimestamp: ").append(getStateTransitionedTimestamp());
sb.append("}");
return sb.toString();
}
@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (obj instanceof MetricAlarm == false)
return false;
MetricAlarm other = (MetricAlarm) obj;
if (other.getAlarmName() == null ^ this.getAlarmName() == null)
return false;
if (other.getAlarmName() != null && other.getAlarmName().equals(this.getAlarmName()) == false)
return false;
if (other.getAlarmArn() == null ^ this.getAlarmArn() == null)
return false;
if (other.getAlarmArn() != null && other.getAlarmArn().equals(this.getAlarmArn()) == false)
return false;
if (other.getAlarmDescription() == null ^ this.getAlarmDescription() == null)
return false;
if (other.getAlarmDescription() != null && other.getAlarmDescription().equals(this.getAlarmDescription()) == false)
return false;
if (other.getAlarmConfigurationUpdatedTimestamp() == null ^ this.getAlarmConfigurationUpdatedTimestamp() == null)
return false;
if (other.getAlarmConfigurationUpdatedTimestamp() != null
&& other.getAlarmConfigurationUpdatedTimestamp().equals(this.getAlarmConfigurationUpdatedTimestamp()) == false)
return false;
if (other.getActionsEnabled() == null ^ this.getActionsEnabled() == null)
return false;
if (other.getActionsEnabled() != null && other.getActionsEnabled().equals(this.getActionsEnabled()) == false)
return false;
if (other.getOKActions() == null ^ this.getOKActions() == null)
return false;
if (other.getOKActions() != null && other.getOKActions().equals(this.getOKActions()) == false)
return false;
if (other.getAlarmActions() == null ^ this.getAlarmActions() == null)
return false;
if (other.getAlarmActions() != null && other.getAlarmActions().equals(this.getAlarmActions()) == false)
return false;
if (other.getInsufficientDataActions() == null ^ this.getInsufficientDataActions() == null)
return false;
if (other.getInsufficientDataActions() != null && other.getInsufficientDataActions().equals(this.getInsufficientDataActions()) == false)
return false;
if (other.getStateValue() == null ^ this.getStateValue() == null)
return false;
if (other.getStateValue() != null && other.getStateValue().equals(this.getStateValue()) == false)
return false;
if (other.getStateReason() == null ^ this.getStateReason() == null)
return false;
if (other.getStateReason() != null && other.getStateReason().equals(this.getStateReason()) == false)
return false;
if (other.getStateReasonData() == null ^ this.getStateReasonData() == null)
return false;
if (other.getStateReasonData() != null && other.getStateReasonData().equals(this.getStateReasonData()) == false)
return false;
if (other.getStateUpdatedTimestamp() == null ^ this.getStateUpdatedTimestamp() == null)
return false;
if (other.getStateUpdatedTimestamp() != null && other.getStateUpdatedTimestamp().equals(this.getStateUpdatedTimestamp()) == false)
return false;
if (other.getMetricName() == null ^ this.getMetricName() == null)
return false;
if (other.getMetricName() != null && other.getMetricName().equals(this.getMetricName()) == false)
return false;
if (other.getNamespace() == null ^ this.getNamespace() == null)
return false;
if (other.getNamespace() != null && other.getNamespace().equals(this.getNamespace()) == false)
return false;
if (other.getStatistic() == null ^ this.getStatistic() == null)
return false;
if (other.getStatistic() != null && other.getStatistic().equals(this.getStatistic()) == false)
return false;
if (other.getExtendedStatistic() == null ^ this.getExtendedStatistic() == null)
return false;
if (other.getExtendedStatistic() != null && other.getExtendedStatistic().equals(this.getExtendedStatistic()) == false)
return false;
if (other.getDimensions() == null ^ this.getDimensions() == null)
return false;
if (other.getDimensions() != null && other.getDimensions().equals(this.getDimensions()) == false)
return false;
if (other.getPeriod() == null ^ this.getPeriod() == null)
return false;
if (other.getPeriod() != null && other.getPeriod().equals(this.getPeriod()) == false)
return false;
if (other.getUnit() == null ^ this.getUnit() == null)
return false;
if (other.getUnit() != null && other.getUnit().equals(this.getUnit()) == false)
return false;
if (other.getEvaluationPeriods() == null ^ this.getEvaluationPeriods() == null)
return false;
if (other.getEvaluationPeriods() != null && other.getEvaluationPeriods().equals(this.getEvaluationPeriods()) == false)
return false;
if (other.getDatapointsToAlarm() == null ^ this.getDatapointsToAlarm() == null)
return false;
if (other.getDatapointsToAlarm() != null && other.getDatapointsToAlarm().equals(this.getDatapointsToAlarm()) == false)
return false;
if (other.getThreshold() == null ^ this.getThreshold() == null)
return false;
if (other.getThreshold() != null && other.getThreshold().equals(this.getThreshold()) == false)
return false;
if (other.getComparisonOperator() == null ^ this.getComparisonOperator() == null)
return false;
if (other.getComparisonOperator() != null && other.getComparisonOperator().equals(this.getComparisonOperator()) == false)
return false;
if (other.getTreatMissingData() == null ^ this.getTreatMissingData() == null)
return false;
if (other.getTreatMissingData() != null && other.getTreatMissingData().equals(this.getTreatMissingData()) == false)
return false;
if (other.getEvaluateLowSampleCountPercentile() == null ^ this.getEvaluateLowSampleCountPercentile() == null)
return false;
if (other.getEvaluateLowSampleCountPercentile() != null
&& other.getEvaluateLowSampleCountPercentile().equals(this.getEvaluateLowSampleCountPercentile()) == false)
return false;
if (other.getMetrics() == null ^ this.getMetrics() == null)
return false;
if (other.getMetrics() != null && other.getMetrics().equals(this.getMetrics()) == false)
return false;
if (other.getThresholdMetricId() == null ^ this.getThresholdMetricId() == null)
return false;
if (other.getThresholdMetricId() != null && other.getThresholdMetricId().equals(this.getThresholdMetricId()) == false)
return false;
if (other.getEvaluationState() == null ^ this.getEvaluationState() == null)
return false;
if (other.getEvaluationState() != null && other.getEvaluationState().equals(this.getEvaluationState()) == false)
return false;
if (other.getStateTransitionedTimestamp() == null ^ this.getStateTransitionedTimestamp() == null)
return false;
if (other.getStateTransitionedTimestamp() != null && other.getStateTransitionedTimestamp().equals(this.getStateTransitionedTimestamp()) == false)
return false;
return true;
}
@Override
public int hashCode() {
final int prime = 31;
int hashCode = 1;
hashCode = prime * hashCode + ((getAlarmName() == null) ? 0 : getAlarmName().hashCode());
hashCode = prime * hashCode + ((getAlarmArn() == null) ? 0 : getAlarmArn().hashCode());
hashCode = prime * hashCode + ((getAlarmDescription() == null) ? 0 : getAlarmDescription().hashCode());
hashCode = prime * hashCode + ((getAlarmConfigurationUpdatedTimestamp() == null) ? 0 : getAlarmConfigurationUpdatedTimestamp().hashCode());
hashCode = prime * hashCode + ((getActionsEnabled() == null) ? 0 : getActionsEnabled().hashCode());
hashCode = prime * hashCode + ((getOKActions() == null) ? 0 : getOKActions().hashCode());
hashCode = prime * hashCode + ((getAlarmActions() == null) ? 0 : getAlarmActions().hashCode());
hashCode = prime * hashCode + ((getInsufficientDataActions() == null) ? 0 : getInsufficientDataActions().hashCode());
hashCode = prime * hashCode + ((getStateValue() == null) ? 0 : getStateValue().hashCode());
hashCode = prime * hashCode + ((getStateReason() == null) ? 0 : getStateReason().hashCode());
hashCode = prime * hashCode + ((getStateReasonData() == null) ? 0 : getStateReasonData().hashCode());
hashCode = prime * hashCode + ((getStateUpdatedTimestamp() == null) ? 0 : getStateUpdatedTimestamp().hashCode());
hashCode = prime * hashCode + ((getMetricName() == null) ? 0 : getMetricName().hashCode());
hashCode = prime * hashCode + ((getNamespace() == null) ? 0 : getNamespace().hashCode());
hashCode = prime * hashCode + ((getStatistic() == null) ? 0 : getStatistic().hashCode());
hashCode = prime * hashCode + ((getExtendedStatistic() == null) ? 0 : getExtendedStatistic().hashCode());
hashCode = prime * hashCode + ((getDimensions() == null) ? 0 : getDimensions().hashCode());
hashCode = prime * hashCode + ((getPeriod() == null) ? 0 : getPeriod().hashCode());
hashCode = prime * hashCode + ((getUnit() == null) ? 0 : getUnit().hashCode());
hashCode = prime * hashCode + ((getEvaluationPeriods() == null) ? 0 : getEvaluationPeriods().hashCode());
hashCode = prime * hashCode + ((getDatapointsToAlarm() == null) ? 0 : getDatapointsToAlarm().hashCode());
hashCode = prime * hashCode + ((getThreshold() == null) ? 0 : getThreshold().hashCode());
hashCode = prime * hashCode + ((getComparisonOperator() == null) ? 0 : getComparisonOperator().hashCode());
hashCode = prime * hashCode + ((getTreatMissingData() == null) ? 0 : getTreatMissingData().hashCode());
hashCode = prime * hashCode + ((getEvaluateLowSampleCountPercentile() == null) ? 0 : getEvaluateLowSampleCountPercentile().hashCode());
hashCode = prime * hashCode + ((getMetrics() == null) ? 0 : getMetrics().hashCode());
hashCode = prime * hashCode + ((getThresholdMetricId() == null) ? 0 : getThresholdMetricId().hashCode());
hashCode = prime * hashCode + ((getEvaluationState() == null) ? 0 : getEvaluationState().hashCode());
hashCode = prime * hashCode + ((getStateTransitionedTimestamp() == null) ? 0 : getStateTransitionedTimestamp().hashCode());
return hashCode;
}
@Override
public MetricAlarm clone() {
try {
return (MetricAlarm) super.clone();
} catch (CloneNotSupportedException e) {
throw new IllegalStateException("Got a CloneNotSupportedException from Object.clone() " + "even though we're Cloneable!", e);
}
}
}