
com.amazonaws.services.autoscaling.model.GetPredictiveScalingForecastResult 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;
/**
*
* @see AWS API Documentation
*/
@Generated("com.amazonaws:aws-java-sdk-code-generator")
public class GetPredictiveScalingForecastResult extends com.amazonaws.AmazonWebServiceResult implements Serializable, Cloneable {
/**
*
* The load forecast.
*
*/
private com.amazonaws.internal.SdkInternalList loadForecast;
/**
*
* The capacity forecast.
*
*/
private CapacityForecast capacityForecast;
/**
*
* The time the forecast was made.
*
*/
private java.util.Date updateTime;
/**
*
* The load forecast.
*
*
* @return The load forecast.
*/
public java.util.List getLoadForecast() {
if (loadForecast == null) {
loadForecast = new com.amazonaws.internal.SdkInternalList();
}
return loadForecast;
}
/**
*
* The load forecast.
*
*
* @param loadForecast
* The load forecast.
*/
public void setLoadForecast(java.util.Collection loadForecast) {
if (loadForecast == null) {
this.loadForecast = null;
return;
}
this.loadForecast = new com.amazonaws.internal.SdkInternalList(loadForecast);
}
/**
*
* The load forecast.
*
*
* NOTE: This method appends the values to the existing list (if any). Use
* {@link #setLoadForecast(java.util.Collection)} or {@link #withLoadForecast(java.util.Collection)} if you want to
* override the existing values.
*
*
* @param loadForecast
* The load forecast.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public GetPredictiveScalingForecastResult withLoadForecast(LoadForecast... loadForecast) {
if (this.loadForecast == null) {
setLoadForecast(new com.amazonaws.internal.SdkInternalList(loadForecast.length));
}
for (LoadForecast ele : loadForecast) {
this.loadForecast.add(ele);
}
return this;
}
/**
*
* The load forecast.
*
*
* @param loadForecast
* The load forecast.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public GetPredictiveScalingForecastResult withLoadForecast(java.util.Collection loadForecast) {
setLoadForecast(loadForecast);
return this;
}
/**
*
* The capacity forecast.
*
*
* @param capacityForecast
* The capacity forecast.
*/
public void setCapacityForecast(CapacityForecast capacityForecast) {
this.capacityForecast = capacityForecast;
}
/**
*
* The capacity forecast.
*
*
* @return The capacity forecast.
*/
public CapacityForecast getCapacityForecast() {
return this.capacityForecast;
}
/**
*
* The capacity forecast.
*
*
* @param capacityForecast
* The capacity forecast.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public GetPredictiveScalingForecastResult withCapacityForecast(CapacityForecast capacityForecast) {
setCapacityForecast(capacityForecast);
return this;
}
/**
*
* The time the forecast was made.
*
*
* @param updateTime
* The time the forecast was made.
*/
public void setUpdateTime(java.util.Date updateTime) {
this.updateTime = updateTime;
}
/**
*
* The time the forecast was made.
*
*
* @return The time the forecast was made.
*/
public java.util.Date getUpdateTime() {
return this.updateTime;
}
/**
*
* The time the forecast was made.
*
*
* @param updateTime
* The time the forecast was made.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public GetPredictiveScalingForecastResult withUpdateTime(java.util.Date updateTime) {
setUpdateTime(updateTime);
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 (getLoadForecast() != null)
sb.append("LoadForecast: ").append(getLoadForecast()).append(",");
if (getCapacityForecast() != null)
sb.append("CapacityForecast: ").append(getCapacityForecast()).append(",");
if (getUpdateTime() != null)
sb.append("UpdateTime: ").append(getUpdateTime());
sb.append("}");
return sb.toString();
}
@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (obj instanceof GetPredictiveScalingForecastResult == false)
return false;
GetPredictiveScalingForecastResult other = (GetPredictiveScalingForecastResult) obj;
if (other.getLoadForecast() == null ^ this.getLoadForecast() == null)
return false;
if (other.getLoadForecast() != null && other.getLoadForecast().equals(this.getLoadForecast()) == false)
return false;
if (other.getCapacityForecast() == null ^ this.getCapacityForecast() == null)
return false;
if (other.getCapacityForecast() != null && other.getCapacityForecast().equals(this.getCapacityForecast()) == false)
return false;
if (other.getUpdateTime() == null ^ this.getUpdateTime() == null)
return false;
if (other.getUpdateTime() != null && other.getUpdateTime().equals(this.getUpdateTime()) == false)
return false;
return true;
}
@Override
public int hashCode() {
final int prime = 31;
int hashCode = 1;
hashCode = prime * hashCode + ((getLoadForecast() == null) ? 0 : getLoadForecast().hashCode());
hashCode = prime * hashCode + ((getCapacityForecast() == null) ? 0 : getCapacityForecast().hashCode());
hashCode = prime * hashCode + ((getUpdateTime() == null) ? 0 : getUpdateTime().hashCode());
return hashCode;
}
@Override
public GetPredictiveScalingForecastResult clone() {
try {
return (GetPredictiveScalingForecastResult) super.clone();
} catch (CloneNotSupportedException e) {
throw new IllegalStateException("Got a CloneNotSupportedException from Object.clone() " + "even though we're Cloneable!", e);
}
}
}