com.amazonaws.services.autoscaling.model.LoadForecast Maven / Gradle / Ivy
Show all versions of aws-java-sdk-autoscaling Show documentation
/*
* Copyright 2016-2021 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;
/**
*
* A GetPredictiveScalingForecast
call returns the load forecast for a predictive scaling policy. This
* structure includes the data points for that load forecast, along with the timestamps of those data points and the
* metric specification.
*
*
* @see AWS API
* Documentation
*/
@Generated("com.amazonaws:aws-java-sdk-code-generator")
public class LoadForecast implements Serializable, Cloneable {
/**
*
* The time stamps for the data points, in UTC format.
*
*/
private com.amazonaws.internal.SdkInternalList timestamps;
/**
*
* The values of the data points.
*
*/
private com.amazonaws.internal.SdkInternalList values;
/**
*
* The metric specification for the load forecast.
*
*/
private PredictiveScalingMetricSpecification metricSpecification;
/**
*
* The time stamps for the data points, in UTC format.
*
*
* @return The time stamps for the data points, in UTC format.
*/
public java.util.List getTimestamps() {
if (timestamps == null) {
timestamps = new com.amazonaws.internal.SdkInternalList();
}
return timestamps;
}
/**
*
* The time stamps for the data points, in UTC format.
*
*
* @param timestamps
* The time stamps for the data points, in UTC format.
*/
public void setTimestamps(java.util.Collection timestamps) {
if (timestamps == null) {
this.timestamps = null;
return;
}
this.timestamps = new com.amazonaws.internal.SdkInternalList(timestamps);
}
/**
*
* The time stamps for the data points, in UTC format.
*
*
* NOTE: This method appends the values to the existing list (if any). Use
* {@link #setTimestamps(java.util.Collection)} or {@link #withTimestamps(java.util.Collection)} if you want to
* override the existing values.
*
*
* @param timestamps
* The time stamps for the data points, in UTC format.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public LoadForecast withTimestamps(java.util.Date... timestamps) {
if (this.timestamps == null) {
setTimestamps(new com.amazonaws.internal.SdkInternalList(timestamps.length));
}
for (java.util.Date ele : timestamps) {
this.timestamps.add(ele);
}
return this;
}
/**
*
* The time stamps for the data points, in UTC format.
*
*
* @param timestamps
* The time stamps for the data points, in UTC format.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public LoadForecast withTimestamps(java.util.Collection timestamps) {
setTimestamps(timestamps);
return this;
}
/**
*
* The values of the data points.
*
*
* @return The values of the data points.
*/
public java.util.List getValues() {
if (values == null) {
values = new com.amazonaws.internal.SdkInternalList();
}
return values;
}
/**
*
* The values of the data points.
*
*
* @param values
* The values of the data points.
*/
public void setValues(java.util.Collection values) {
if (values == null) {
this.values = null;
return;
}
this.values = new com.amazonaws.internal.SdkInternalList(values);
}
/**
*
* The values of the data points.
*
*
* NOTE: This method appends the values to the existing list (if any). Use
* {@link #setValues(java.util.Collection)} or {@link #withValues(java.util.Collection)} if you want to override the
* existing values.
*
*
* @param values
* The values of the data points.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public LoadForecast withValues(Double... values) {
if (this.values == null) {
setValues(new com.amazonaws.internal.SdkInternalList(values.length));
}
for (Double ele : values) {
this.values.add(ele);
}
return this;
}
/**
*
* The values of the data points.
*
*
* @param values
* The values of the data points.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public LoadForecast withValues(java.util.Collection values) {
setValues(values);
return this;
}
/**
*
* The metric specification for the load forecast.
*
*
* @param metricSpecification
* The metric specification for the load forecast.
*/
public void setMetricSpecification(PredictiveScalingMetricSpecification metricSpecification) {
this.metricSpecification = metricSpecification;
}
/**
*
* The metric specification for the load forecast.
*
*
* @return The metric specification for the load forecast.
*/
public PredictiveScalingMetricSpecification getMetricSpecification() {
return this.metricSpecification;
}
/**
*
* The metric specification for the load forecast.
*
*
* @param metricSpecification
* The metric specification for the load forecast.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public LoadForecast withMetricSpecification(PredictiveScalingMetricSpecification metricSpecification) {
setMetricSpecification(metricSpecification);
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 (getTimestamps() != null)
sb.append("Timestamps: ").append(getTimestamps()).append(",");
if (getValues() != null)
sb.append("Values: ").append(getValues()).append(",");
if (getMetricSpecification() != null)
sb.append("MetricSpecification: ").append(getMetricSpecification());
sb.append("}");
return sb.toString();
}
@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (obj instanceof LoadForecast == false)
return false;
LoadForecast other = (LoadForecast) obj;
if (other.getTimestamps() == null ^ this.getTimestamps() == null)
return false;
if (other.getTimestamps() != null && other.getTimestamps().equals(this.getTimestamps()) == false)
return false;
if (other.getValues() == null ^ this.getValues() == null)
return false;
if (other.getValues() != null && other.getValues().equals(this.getValues()) == false)
return false;
if (other.getMetricSpecification() == null ^ this.getMetricSpecification() == null)
return false;
if (other.getMetricSpecification() != null && other.getMetricSpecification().equals(this.getMetricSpecification()) == false)
return false;
return true;
}
@Override
public int hashCode() {
final int prime = 31;
int hashCode = 1;
hashCode = prime * hashCode + ((getTimestamps() == null) ? 0 : getTimestamps().hashCode());
hashCode = prime * hashCode + ((getValues() == null) ? 0 : getValues().hashCode());
hashCode = prime * hashCode + ((getMetricSpecification() == null) ? 0 : getMetricSpecification().hashCode());
return hashCode;
}
@Override
public LoadForecast clone() {
try {
return (LoadForecast) super.clone();
} catch (CloneNotSupportedException e) {
throw new IllegalStateException("Got a CloneNotSupportedException from Object.clone() " + "even though we're Cloneable!", e);
}
}
}