
com.amazonaws.services.lightsail.model.ResourceBudgetEstimate Maven / Gradle / Ivy
/*
* Copyright 2018-2023 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.lightsail.model;
import java.io.Serializable;
import javax.annotation.Generated;
import com.amazonaws.protocol.StructuredPojo;
import com.amazonaws.protocol.ProtocolMarshaller;
/**
*
* Describes the estimated cost or usage that a budget tracks.
*
*
* @see AWS
* API Documentation
*/
@Generated("com.amazonaws:aws-java-sdk-code-generator")
public class ResourceBudgetEstimate implements Serializable, Cloneable, StructuredPojo {
/**
*
* The resource name.
*
*/
private String resourceName;
/**
*
* The type of resource the budget will track.
*
*/
private String resourceType;
/**
*
* The cost estimate for the specified budget.
*
*/
private java.util.List costEstimates;
/**
*
* The estimate start time.
*
*/
private java.util.Date startTime;
/**
*
* The estimate end time.
*
*/
private java.util.Date endTime;
/**
*
* The resource name.
*
*
* @param resourceName
* The resource name.
*/
public void setResourceName(String resourceName) {
this.resourceName = resourceName;
}
/**
*
* The resource name.
*
*
* @return The resource name.
*/
public String getResourceName() {
return this.resourceName;
}
/**
*
* The resource name.
*
*
* @param resourceName
* The resource name.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public ResourceBudgetEstimate withResourceName(String resourceName) {
setResourceName(resourceName);
return this;
}
/**
*
* The type of resource the budget will track.
*
*
* @param resourceType
* The type of resource the budget will track.
* @see ResourceType
*/
public void setResourceType(String resourceType) {
this.resourceType = resourceType;
}
/**
*
* The type of resource the budget will track.
*
*
* @return The type of resource the budget will track.
* @see ResourceType
*/
public String getResourceType() {
return this.resourceType;
}
/**
*
* The type of resource the budget will track.
*
*
* @param resourceType
* The type of resource the budget will track.
* @return Returns a reference to this object so that method calls can be chained together.
* @see ResourceType
*/
public ResourceBudgetEstimate withResourceType(String resourceType) {
setResourceType(resourceType);
return this;
}
/**
*
* The type of resource the budget will track.
*
*
* @param resourceType
* The type of resource the budget will track.
* @return Returns a reference to this object so that method calls can be chained together.
* @see ResourceType
*/
public ResourceBudgetEstimate withResourceType(ResourceType resourceType) {
this.resourceType = resourceType.toString();
return this;
}
/**
*
* The cost estimate for the specified budget.
*
*
* @return The cost estimate for the specified budget.
*/
public java.util.List getCostEstimates() {
return costEstimates;
}
/**
*
* The cost estimate for the specified budget.
*
*
* @param costEstimates
* The cost estimate for the specified budget.
*/
public void setCostEstimates(java.util.Collection costEstimates) {
if (costEstimates == null) {
this.costEstimates = null;
return;
}
this.costEstimates = new java.util.ArrayList(costEstimates);
}
/**
*
* The cost estimate for the specified budget.
*
*
* NOTE: This method appends the values to the existing list (if any). Use
* {@link #setCostEstimates(java.util.Collection)} or {@link #withCostEstimates(java.util.Collection)} if you want
* to override the existing values.
*
*
* @param costEstimates
* The cost estimate for the specified budget.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public ResourceBudgetEstimate withCostEstimates(CostEstimate... costEstimates) {
if (this.costEstimates == null) {
setCostEstimates(new java.util.ArrayList(costEstimates.length));
}
for (CostEstimate ele : costEstimates) {
this.costEstimates.add(ele);
}
return this;
}
/**
*
* The cost estimate for the specified budget.
*
*
* @param costEstimates
* The cost estimate for the specified budget.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public ResourceBudgetEstimate withCostEstimates(java.util.Collection costEstimates) {
setCostEstimates(costEstimates);
return this;
}
/**
*
* The estimate start time.
*
*
* @param startTime
* The estimate start time.
*/
public void setStartTime(java.util.Date startTime) {
this.startTime = startTime;
}
/**
*
* The estimate start time.
*
*
* @return The estimate start time.
*/
public java.util.Date getStartTime() {
return this.startTime;
}
/**
*
* The estimate start time.
*
*
* @param startTime
* The estimate start time.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public ResourceBudgetEstimate withStartTime(java.util.Date startTime) {
setStartTime(startTime);
return this;
}
/**
*
* The estimate end time.
*
*
* @param endTime
* The estimate end time.
*/
public void setEndTime(java.util.Date endTime) {
this.endTime = endTime;
}
/**
*
* The estimate end time.
*
*
* @return The estimate end time.
*/
public java.util.Date getEndTime() {
return this.endTime;
}
/**
*
* The estimate end time.
*
*
* @param endTime
* The estimate end time.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public ResourceBudgetEstimate withEndTime(java.util.Date endTime) {
setEndTime(endTime);
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 (getResourceName() != null)
sb.append("ResourceName: ").append(getResourceName()).append(",");
if (getResourceType() != null)
sb.append("ResourceType: ").append(getResourceType()).append(",");
if (getCostEstimates() != null)
sb.append("CostEstimates: ").append(getCostEstimates()).append(",");
if (getStartTime() != null)
sb.append("StartTime: ").append(getStartTime()).append(",");
if (getEndTime() != null)
sb.append("EndTime: ").append(getEndTime());
sb.append("}");
return sb.toString();
}
@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (obj instanceof ResourceBudgetEstimate == false)
return false;
ResourceBudgetEstimate other = (ResourceBudgetEstimate) obj;
if (other.getResourceName() == null ^ this.getResourceName() == null)
return false;
if (other.getResourceName() != null && other.getResourceName().equals(this.getResourceName()) == false)
return false;
if (other.getResourceType() == null ^ this.getResourceType() == null)
return false;
if (other.getResourceType() != null && other.getResourceType().equals(this.getResourceType()) == false)
return false;
if (other.getCostEstimates() == null ^ this.getCostEstimates() == null)
return false;
if (other.getCostEstimates() != null && other.getCostEstimates().equals(this.getCostEstimates()) == false)
return false;
if (other.getStartTime() == null ^ this.getStartTime() == null)
return false;
if (other.getStartTime() != null && other.getStartTime().equals(this.getStartTime()) == false)
return false;
if (other.getEndTime() == null ^ this.getEndTime() == null)
return false;
if (other.getEndTime() != null && other.getEndTime().equals(this.getEndTime()) == false)
return false;
return true;
}
@Override
public int hashCode() {
final int prime = 31;
int hashCode = 1;
hashCode = prime * hashCode + ((getResourceName() == null) ? 0 : getResourceName().hashCode());
hashCode = prime * hashCode + ((getResourceType() == null) ? 0 : getResourceType().hashCode());
hashCode = prime * hashCode + ((getCostEstimates() == null) ? 0 : getCostEstimates().hashCode());
hashCode = prime * hashCode + ((getStartTime() == null) ? 0 : getStartTime().hashCode());
hashCode = prime * hashCode + ((getEndTime() == null) ? 0 : getEndTime().hashCode());
return hashCode;
}
@Override
public ResourceBudgetEstimate clone() {
try {
return (ResourceBudgetEstimate) 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.lightsail.model.transform.ResourceBudgetEstimateMarshaller.getInstance().marshall(this, protocolMarshaller);
}
}