com.amazonaws.services.costexplorer.model.RightsizingRecommendation Maven / Gradle / Ivy
Show all versions of aws-java-sdk-costexplorer Show documentation
/*
* Copyright 2015-2020 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;
import com.amazonaws.protocol.StructuredPojo;
import com.amazonaws.protocol.ProtocolMarshaller;
/**
*
* Recommendations to rightsize resources.
*
*
* @see AWS API
* Documentation
*/
@Generated("com.amazonaws:aws-java-sdk-code-generator")
public class RightsizingRecommendation implements Serializable, Cloneable, StructuredPojo {
/**
*
* The account that this recommendation is for.
*
*/
private String accountId;
/**
*
* Context regarding the current instance.
*
*/
private CurrentInstance currentInstance;
/**
*
* Recommendation to either terminate or modify the resource.
*
*/
private String rightsizingType;
/**
*
* Details for modification recommendations.
*
*/
private ModifyRecommendationDetail modifyRecommendationDetail;
/**
*
* Details for termination recommendations.
*
*/
private TerminateRecommendationDetail terminateRecommendationDetail;
/**
*
* The account that this recommendation is for.
*
*
* @param accountId
* The account that this recommendation is for.
*/
public void setAccountId(String accountId) {
this.accountId = accountId;
}
/**
*
* The account that this recommendation is for.
*
*
* @return The account that this recommendation is for.
*/
public String getAccountId() {
return this.accountId;
}
/**
*
* The account that this recommendation is for.
*
*
* @param accountId
* The account that this recommendation is for.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public RightsizingRecommendation withAccountId(String accountId) {
setAccountId(accountId);
return this;
}
/**
*
* Context regarding the current instance.
*
*
* @param currentInstance
* Context regarding the current instance.
*/
public void setCurrentInstance(CurrentInstance currentInstance) {
this.currentInstance = currentInstance;
}
/**
*
* Context regarding the current instance.
*
*
* @return Context regarding the current instance.
*/
public CurrentInstance getCurrentInstance() {
return this.currentInstance;
}
/**
*
* Context regarding the current instance.
*
*
* @param currentInstance
* Context regarding the current instance.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public RightsizingRecommendation withCurrentInstance(CurrentInstance currentInstance) {
setCurrentInstance(currentInstance);
return this;
}
/**
*
* Recommendation to either terminate or modify the resource.
*
*
* @param rightsizingType
* Recommendation to either terminate or modify the resource.
* @see RightsizingType
*/
public void setRightsizingType(String rightsizingType) {
this.rightsizingType = rightsizingType;
}
/**
*
* Recommendation to either terminate or modify the resource.
*
*
* @return Recommendation to either terminate or modify the resource.
* @see RightsizingType
*/
public String getRightsizingType() {
return this.rightsizingType;
}
/**
*
* Recommendation to either terminate or modify the resource.
*
*
* @param rightsizingType
* Recommendation to either terminate or modify the resource.
* @return Returns a reference to this object so that method calls can be chained together.
* @see RightsizingType
*/
public RightsizingRecommendation withRightsizingType(String rightsizingType) {
setRightsizingType(rightsizingType);
return this;
}
/**
*
* Recommendation to either terminate or modify the resource.
*
*
* @param rightsizingType
* Recommendation to either terminate or modify the resource.
* @return Returns a reference to this object so that method calls can be chained together.
* @see RightsizingType
*/
public RightsizingRecommendation withRightsizingType(RightsizingType rightsizingType) {
this.rightsizingType = rightsizingType.toString();
return this;
}
/**
*
* Details for modification recommendations.
*
*
* @param modifyRecommendationDetail
* Details for modification recommendations.
*/
public void setModifyRecommendationDetail(ModifyRecommendationDetail modifyRecommendationDetail) {
this.modifyRecommendationDetail = modifyRecommendationDetail;
}
/**
*
* Details for modification recommendations.
*
*
* @return Details for modification recommendations.
*/
public ModifyRecommendationDetail getModifyRecommendationDetail() {
return this.modifyRecommendationDetail;
}
/**
*
* Details for modification recommendations.
*
*
* @param modifyRecommendationDetail
* Details for modification recommendations.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public RightsizingRecommendation withModifyRecommendationDetail(ModifyRecommendationDetail modifyRecommendationDetail) {
setModifyRecommendationDetail(modifyRecommendationDetail);
return this;
}
/**
*
* Details for termination recommendations.
*
*
* @param terminateRecommendationDetail
* Details for termination recommendations.
*/
public void setTerminateRecommendationDetail(TerminateRecommendationDetail terminateRecommendationDetail) {
this.terminateRecommendationDetail = terminateRecommendationDetail;
}
/**
*
* Details for termination recommendations.
*
*
* @return Details for termination recommendations.
*/
public TerminateRecommendationDetail getTerminateRecommendationDetail() {
return this.terminateRecommendationDetail;
}
/**
*
* Details for termination recommendations.
*
*
* @param terminateRecommendationDetail
* Details for termination recommendations.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public RightsizingRecommendation withTerminateRecommendationDetail(TerminateRecommendationDetail terminateRecommendationDetail) {
setTerminateRecommendationDetail(terminateRecommendationDetail);
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 (getAccountId() != null)
sb.append("AccountId: ").append(getAccountId()).append(",");
if (getCurrentInstance() != null)
sb.append("CurrentInstance: ").append(getCurrentInstance()).append(",");
if (getRightsizingType() != null)
sb.append("RightsizingType: ").append(getRightsizingType()).append(",");
if (getModifyRecommendationDetail() != null)
sb.append("ModifyRecommendationDetail: ").append(getModifyRecommendationDetail()).append(",");
if (getTerminateRecommendationDetail() != null)
sb.append("TerminateRecommendationDetail: ").append(getTerminateRecommendationDetail());
sb.append("}");
return sb.toString();
}
@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (obj instanceof RightsizingRecommendation == false)
return false;
RightsizingRecommendation other = (RightsizingRecommendation) obj;
if (other.getAccountId() == null ^ this.getAccountId() == null)
return false;
if (other.getAccountId() != null && other.getAccountId().equals(this.getAccountId()) == false)
return false;
if (other.getCurrentInstance() == null ^ this.getCurrentInstance() == null)
return false;
if (other.getCurrentInstance() != null && other.getCurrentInstance().equals(this.getCurrentInstance()) == false)
return false;
if (other.getRightsizingType() == null ^ this.getRightsizingType() == null)
return false;
if (other.getRightsizingType() != null && other.getRightsizingType().equals(this.getRightsizingType()) == false)
return false;
if (other.getModifyRecommendationDetail() == null ^ this.getModifyRecommendationDetail() == null)
return false;
if (other.getModifyRecommendationDetail() != null && other.getModifyRecommendationDetail().equals(this.getModifyRecommendationDetail()) == false)
return false;
if (other.getTerminateRecommendationDetail() == null ^ this.getTerminateRecommendationDetail() == null)
return false;
if (other.getTerminateRecommendationDetail() != null
&& other.getTerminateRecommendationDetail().equals(this.getTerminateRecommendationDetail()) == false)
return false;
return true;
}
@Override
public int hashCode() {
final int prime = 31;
int hashCode = 1;
hashCode = prime * hashCode + ((getAccountId() == null) ? 0 : getAccountId().hashCode());
hashCode = prime * hashCode + ((getCurrentInstance() == null) ? 0 : getCurrentInstance().hashCode());
hashCode = prime * hashCode + ((getRightsizingType() == null) ? 0 : getRightsizingType().hashCode());
hashCode = prime * hashCode + ((getModifyRecommendationDetail() == null) ? 0 : getModifyRecommendationDetail().hashCode());
hashCode = prime * hashCode + ((getTerminateRecommendationDetail() == null) ? 0 : getTerminateRecommendationDetail().hashCode());
return hashCode;
}
@Override
public RightsizingRecommendation clone() {
try {
return (RightsizingRecommendation) 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.costexplorer.model.transform.RightsizingRecommendationMarshaller.getInstance().marshall(this, protocolMarshaller);
}
}