
com.amazonaws.services.costexplorer.model.GetUsageForecastResult Maven / Gradle / Ivy
Show all versions of aws-java-sdk-costexplorer Show documentation
/*
* Copyright 2020-2025 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.costexplorer.model;
import java.io.Serializable;
import javax.annotation.Generated;
/**
*
* @see AWS API
* Documentation
*/
@Generated("com.amazonaws:aws-java-sdk-code-generator")
public class GetUsageForecastResult extends com.amazonaws.AmazonWebServiceResult implements Serializable, Cloneable {
/**
*
* How much you're forecasted to use over the forecast period.
*
*/
private MetricValue total;
/**
*
* The forecasts for your query, in order. For DAILY
forecasts, this is a list of days. For
* MONTHLY
forecasts, this is a list of months.
*
*/
private java.util.List forecastResultsByTime;
/**
*
* How much you're forecasted to use over the forecast period.
*
*
* @param total
* How much you're forecasted to use over the forecast period.
*/
public void setTotal(MetricValue total) {
this.total = total;
}
/**
*
* How much you're forecasted to use over the forecast period.
*
*
* @return How much you're forecasted to use over the forecast period.
*/
public MetricValue getTotal() {
return this.total;
}
/**
*
* How much you're forecasted to use over the forecast period.
*
*
* @param total
* How much you're forecasted to use over the forecast period.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public GetUsageForecastResult withTotal(MetricValue total) {
setTotal(total);
return this;
}
/**
*
* The forecasts for your query, in order. For DAILY
forecasts, this is a list of days. For
* MONTHLY
forecasts, this is a list of months.
*
*
* @return The forecasts for your query, in order. For DAILY
forecasts, this is a list of days. For
* MONTHLY
forecasts, this is a list of months.
*/
public java.util.List getForecastResultsByTime() {
return forecastResultsByTime;
}
/**
*
* The forecasts for your query, in order. For DAILY
forecasts, this is a list of days. For
* MONTHLY
forecasts, this is a list of months.
*
*
* @param forecastResultsByTime
* The forecasts for your query, in order. For DAILY
forecasts, this is a list of days. For
* MONTHLY
forecasts, this is a list of months.
*/
public void setForecastResultsByTime(java.util.Collection forecastResultsByTime) {
if (forecastResultsByTime == null) {
this.forecastResultsByTime = null;
return;
}
this.forecastResultsByTime = new java.util.ArrayList(forecastResultsByTime);
}
/**
*
* The forecasts for your query, in order. For DAILY
forecasts, this is a list of days. For
* MONTHLY
forecasts, this is a list of months.
*
*
* NOTE: This method appends the values to the existing list (if any). Use
* {@link #setForecastResultsByTime(java.util.Collection)} or
* {@link #withForecastResultsByTime(java.util.Collection)} if you want to override the existing values.
*
*
* @param forecastResultsByTime
* The forecasts for your query, in order. For DAILY
forecasts, this is a list of days. For
* MONTHLY
forecasts, this is a list of months.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public GetUsageForecastResult withForecastResultsByTime(ForecastResult... forecastResultsByTime) {
if (this.forecastResultsByTime == null) {
setForecastResultsByTime(new java.util.ArrayList(forecastResultsByTime.length));
}
for (ForecastResult ele : forecastResultsByTime) {
this.forecastResultsByTime.add(ele);
}
return this;
}
/**
*
* The forecasts for your query, in order. For DAILY
forecasts, this is a list of days. For
* MONTHLY
forecasts, this is a list of months.
*
*
* @param forecastResultsByTime
* The forecasts for your query, in order. For DAILY
forecasts, this is a list of days. For
* MONTHLY
forecasts, this is a list of months.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public GetUsageForecastResult withForecastResultsByTime(java.util.Collection forecastResultsByTime) {
setForecastResultsByTime(forecastResultsByTime);
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 (getTotal() != null)
sb.append("Total: ").append(getTotal()).append(",");
if (getForecastResultsByTime() != null)
sb.append("ForecastResultsByTime: ").append(getForecastResultsByTime());
sb.append("}");
return sb.toString();
}
@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (obj instanceof GetUsageForecastResult == false)
return false;
GetUsageForecastResult other = (GetUsageForecastResult) obj;
if (other.getTotal() == null ^ this.getTotal() == null)
return false;
if (other.getTotal() != null && other.getTotal().equals(this.getTotal()) == false)
return false;
if (other.getForecastResultsByTime() == null ^ this.getForecastResultsByTime() == null)
return false;
if (other.getForecastResultsByTime() != null && other.getForecastResultsByTime().equals(this.getForecastResultsByTime()) == false)
return false;
return true;
}
@Override
public int hashCode() {
final int prime = 31;
int hashCode = 1;
hashCode = prime * hashCode + ((getTotal() == null) ? 0 : getTotal().hashCode());
hashCode = prime * hashCode + ((getForecastResultsByTime() == null) ? 0 : getForecastResultsByTime().hashCode());
return hashCode;
}
@Override
public GetUsageForecastResult clone() {
try {
return (GetUsageForecastResult) super.clone();
} catch (CloneNotSupportedException e) {
throw new IllegalStateException("Got a CloneNotSupportedException from Object.clone() " + "even though we're Cloneable!", e);
}
}
}