
com.amazonaws.services.autoscaling.model.PredictiveScalingCustomizedLoadMetric Maven / Gradle / Ivy
Show all versions of aws-java-sdk-autoscaling 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.autoscaling.model;
import java.io.Serializable;
import javax.annotation.Generated;
/**
*
* Describes a custom load metric for a predictive scaling policy.
*
*
* @see AWS API Documentation
*/
@Generated("com.amazonaws:aws-java-sdk-code-generator")
public class PredictiveScalingCustomizedLoadMetric implements Serializable, Cloneable {
/**
*
* One or more metric data queries to provide the data points for a load metric. Use multiple metric data queries
* only if you are performing a math expression on returned data.
*
*/
private com.amazonaws.internal.SdkInternalList metricDataQueries;
/**
*
* One or more metric data queries to provide the data points for a load metric. Use multiple metric data queries
* only if you are performing a math expression on returned data.
*
*
* @return One or more metric data queries to provide the data points for a load metric. Use multiple metric data
* queries only if you are performing a math expression on returned data.
*/
public java.util.List getMetricDataQueries() {
if (metricDataQueries == null) {
metricDataQueries = new com.amazonaws.internal.SdkInternalList();
}
return metricDataQueries;
}
/**
*
* One or more metric data queries to provide the data points for a load metric. Use multiple metric data queries
* only if you are performing a math expression on returned data.
*
*
* @param metricDataQueries
* One or more metric data queries to provide the data points for a load metric. Use multiple metric data
* queries only if you are performing a math expression on returned data.
*/
public void setMetricDataQueries(java.util.Collection metricDataQueries) {
if (metricDataQueries == null) {
this.metricDataQueries = null;
return;
}
this.metricDataQueries = new com.amazonaws.internal.SdkInternalList(metricDataQueries);
}
/**
*
* One or more metric data queries to provide the data points for a load metric. Use multiple metric data queries
* only if you are performing a math expression on returned data.
*
*
* NOTE: This method appends the values to the existing list (if any). Use
* {@link #setMetricDataQueries(java.util.Collection)} or {@link #withMetricDataQueries(java.util.Collection)} if
* you want to override the existing values.
*
*
* @param metricDataQueries
* One or more metric data queries to provide the data points for a load metric. Use multiple metric data
* queries only if you are performing a math expression on returned data.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public PredictiveScalingCustomizedLoadMetric withMetricDataQueries(MetricDataQuery... metricDataQueries) {
if (this.metricDataQueries == null) {
setMetricDataQueries(new com.amazonaws.internal.SdkInternalList(metricDataQueries.length));
}
for (MetricDataQuery ele : metricDataQueries) {
this.metricDataQueries.add(ele);
}
return this;
}
/**
*
* One or more metric data queries to provide the data points for a load metric. Use multiple metric data queries
* only if you are performing a math expression on returned data.
*
*
* @param metricDataQueries
* One or more metric data queries to provide the data points for a load metric. Use multiple metric data
* queries only if you are performing a math expression on returned data.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public PredictiveScalingCustomizedLoadMetric withMetricDataQueries(java.util.Collection metricDataQueries) {
setMetricDataQueries(metricDataQueries);
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 (getMetricDataQueries() != null)
sb.append("MetricDataQueries: ").append(getMetricDataQueries());
sb.append("}");
return sb.toString();
}
@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (obj instanceof PredictiveScalingCustomizedLoadMetric == false)
return false;
PredictiveScalingCustomizedLoadMetric other = (PredictiveScalingCustomizedLoadMetric) obj;
if (other.getMetricDataQueries() == null ^ this.getMetricDataQueries() == null)
return false;
if (other.getMetricDataQueries() != null && other.getMetricDataQueries().equals(this.getMetricDataQueries()) == false)
return false;
return true;
}
@Override
public int hashCode() {
final int prime = 31;
int hashCode = 1;
hashCode = prime * hashCode + ((getMetricDataQueries() == null) ? 0 : getMetricDataQueries().hashCode());
return hashCode;
}
@Override
public PredictiveScalingCustomizedLoadMetric clone() {
try {
return (PredictiveScalingCustomizedLoadMetric) super.clone();
} catch (CloneNotSupportedException e) {
throw new IllegalStateException("Got a CloneNotSupportedException from Object.clone() " + "even though we're Cloneable!", e);
}
}
}