com.amazonaws.services.applicationautoscaling.model.TargetTrackingMetricStat Maven / Gradle / Ivy
Show all versions of aws-java-sdk-applicationautoscaling 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.applicationautoscaling.model;
import java.io.Serializable;
import javax.annotation.Generated;
import com.amazonaws.protocol.StructuredPojo;
import com.amazonaws.protocol.ProtocolMarshaller;
/**
*
* This structure defines the CloudWatch metric to return, along with the statistic, period, and unit.
*
*
* For more information about the CloudWatch terminology below, see Amazon CloudWatch
* concepts in the Amazon CloudWatch User Guide.
*
*
* @see AWS API Documentation
*/
@Generated("com.amazonaws:aws-java-sdk-code-generator")
public class TargetTrackingMetricStat implements Serializable, Cloneable, StructuredPojo {
/**
*
* The CloudWatch metric to return, including the metric name, namespace, and dimensions. To get the exact metric
* name, namespace, and dimensions, inspect the Metric object that is
* returned by a call to ListMetrics.
*
*/
private TargetTrackingMetric metric;
/**
*
* The statistic to return. It can include any CloudWatch statistic or extended statistic. For a list of valid
* values, see the table in Statistics in the Amazon CloudWatch User Guide.
*
*
* The most commonly used metric for scaling is Average
.
*
*/
private String stat;
/**
*
* The unit to use for the returned data points. For a complete list of the units that CloudWatch supports, see the
* MetricDatum
* data type in the Amazon CloudWatch API Reference.
*
*/
private String unit;
/**
*
* The CloudWatch metric to return, including the metric name, namespace, and dimensions. To get the exact metric
* name, namespace, and dimensions, inspect the Metric object that is
* returned by a call to ListMetrics.
*
*
* @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 Metric object
* that is returned by a call to ListMetrics.
*/
public void setMetric(TargetTrackingMetric metric) {
this.metric = metric;
}
/**
*
* The CloudWatch metric to return, including the metric name, namespace, and dimensions. To get the exact metric
* name, namespace, and dimensions, inspect the Metric object that is
* returned by a call to ListMetrics.
*
*
* @return The CloudWatch metric to return, including the metric name, namespace, and dimensions. To get the exact
* metric name, namespace, and dimensions, inspect the Metric object
* that is returned by a call to ListMetrics.
*/
public TargetTrackingMetric getMetric() {
return this.metric;
}
/**
*
* The CloudWatch metric to return, including the metric name, namespace, and dimensions. To get the exact metric
* name, namespace, and dimensions, inspect the Metric object that is
* returned by a call to ListMetrics.
*
*
* @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 Metric object
* that is returned by a call to ListMetrics.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public TargetTrackingMetricStat withMetric(TargetTrackingMetric metric) {
setMetric(metric);
return this;
}
/**
*
* The statistic to return. It can include any CloudWatch statistic or extended statistic. For a list of valid
* values, see the table in Statistics in the Amazon CloudWatch User Guide.
*
*
* The most commonly used metric for scaling is Average
.
*
*
* @param stat
* The statistic to return. It can include any CloudWatch statistic or extended statistic. For a list of
* valid values, see the table in Statistics in the Amazon CloudWatch User Guide.
*
* The most commonly used metric for scaling is Average
.
*/
public void setStat(String stat) {
this.stat = stat;
}
/**
*
* The statistic to return. It can include any CloudWatch statistic or extended statistic. For a list of valid
* values, see the table in Statistics in the Amazon CloudWatch User Guide.
*
*
* The most commonly used metric for scaling is Average
.
*
*
* @return The statistic to return. It can include any CloudWatch statistic or extended statistic. For a list of
* valid values, see the table in Statistics in the Amazon CloudWatch User Guide.
*
* The most commonly used metric for scaling is Average
.
*/
public String getStat() {
return this.stat;
}
/**
*
* The statistic to return. It can include any CloudWatch statistic or extended statistic. For a list of valid
* values, see the table in Statistics in the Amazon CloudWatch User Guide.
*
*
* The most commonly used metric for scaling is Average
.
*
*
* @param stat
* The statistic to return. It can include any CloudWatch statistic or extended statistic. For a list of
* valid values, see the table in Statistics in the Amazon CloudWatch User Guide.
*
* The most commonly used metric for scaling is Average
.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public TargetTrackingMetricStat withStat(String stat) {
setStat(stat);
return this;
}
/**
*
* The unit to use for the returned data points. For a complete list of the units that CloudWatch supports, see the
* MetricDatum
* data type in the Amazon CloudWatch API Reference.
*
*
* @param unit
* The unit to use for the returned data points. For a complete list of the units that CloudWatch supports,
* see the MetricDatum
* data type in the Amazon CloudWatch API Reference.
*/
public void setUnit(String unit) {
this.unit = unit;
}
/**
*
* The unit to use for the returned data points. For a complete list of the units that CloudWatch supports, see the
* MetricDatum
* data type in the Amazon CloudWatch API Reference.
*
*
* @return The unit to use for the returned data points. For a complete list of the units that CloudWatch supports,
* see the
* MetricDatum data type in the Amazon CloudWatch API Reference.
*/
public String getUnit() {
return this.unit;
}
/**
*
* The unit to use for the returned data points. For a complete list of the units that CloudWatch supports, see the
* MetricDatum
* data type in the Amazon CloudWatch API Reference.
*
*
* @param unit
* The unit to use for the returned data points. For a complete list of the units that CloudWatch supports,
* see the MetricDatum
* data type in the Amazon CloudWatch API Reference.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public TargetTrackingMetricStat withUnit(String unit) {
setUnit(unit);
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 (getMetric() != null)
sb.append("Metric: ").append(getMetric()).append(",");
if (getStat() != null)
sb.append("Stat: ").append(getStat()).append(",");
if (getUnit() != null)
sb.append("Unit: ").append(getUnit());
sb.append("}");
return sb.toString();
}
@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (obj instanceof TargetTrackingMetricStat == false)
return false;
TargetTrackingMetricStat other = (TargetTrackingMetricStat) obj;
if (other.getMetric() == null ^ this.getMetric() == null)
return false;
if (other.getMetric() != null && other.getMetric().equals(this.getMetric()) == false)
return false;
if (other.getStat() == null ^ this.getStat() == null)
return false;
if (other.getStat() != null && other.getStat().equals(this.getStat()) == false)
return false;
if (other.getUnit() == null ^ this.getUnit() == null)
return false;
if (other.getUnit() != null && other.getUnit().equals(this.getUnit()) == false)
return false;
return true;
}
@Override
public int hashCode() {
final int prime = 31;
int hashCode = 1;
hashCode = prime * hashCode + ((getMetric() == null) ? 0 : getMetric().hashCode());
hashCode = prime * hashCode + ((getStat() == null) ? 0 : getStat().hashCode());
hashCode = prime * hashCode + ((getUnit() == null) ? 0 : getUnit().hashCode());
return hashCode;
}
@Override
public TargetTrackingMetricStat clone() {
try {
return (TargetTrackingMetricStat) super.clone();
} catch (CloneNotSupportedException e) {
throw new IllegalStateException("Got a CloneNotSupportedException from Object.clone() " + "even though we're Cloneable!", e);
}
}
@com.amazonaws.annotation.SdkInternalApi
@Override
public void marshall(ProtocolMarshaller protocolMarshaller) {
com.amazonaws.services.applicationautoscaling.model.transform.TargetTrackingMetricStatMarshaller.getInstance().marshall(this, protocolMarshaller);
}
}