
com.amazonaws.services.costexplorer.model.SavingsPlansDetails 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;
import com.amazonaws.protocol.StructuredPojo;
import com.amazonaws.protocol.ProtocolMarshaller;
/**
*
* The attribute details on a specific Savings Plan.
*
*
* @see AWS API
* Documentation
*/
@Generated("com.amazonaws:aws-java-sdk-code-generator")
public class SavingsPlansDetails implements Serializable, Cloneable, StructuredPojo {
/**
*
* A collection of Amazon Web Services resources in a geographic area. Each Amazon Web Services Region is isolated
* and independent of the other Regions.
*
*/
private String region;
/**
*
* A group of instance types that Savings Plans applies to.
*
*/
private String instanceFamily;
/**
*
* The unique ID that's used to distinguish Savings Plans from one another.
*
*/
private String offeringId;
/**
*
* A collection of Amazon Web Services resources in a geographic area. Each Amazon Web Services Region is isolated
* and independent of the other Regions.
*
*
* @param region
* A collection of Amazon Web Services resources in a geographic area. Each Amazon Web Services Region is
* isolated and independent of the other Regions.
*/
public void setRegion(String region) {
this.region = region;
}
/**
*
* A collection of Amazon Web Services resources in a geographic area. Each Amazon Web Services Region is isolated
* and independent of the other Regions.
*
*
* @return A collection of Amazon Web Services resources in a geographic area. Each Amazon Web Services Region is
* isolated and independent of the other Regions.
*/
public String getRegion() {
return this.region;
}
/**
*
* A collection of Amazon Web Services resources in a geographic area. Each Amazon Web Services Region is isolated
* and independent of the other Regions.
*
*
* @param region
* A collection of Amazon Web Services resources in a geographic area. Each Amazon Web Services Region is
* isolated and independent of the other Regions.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public SavingsPlansDetails withRegion(String region) {
setRegion(region);
return this;
}
/**
*
* A group of instance types that Savings Plans applies to.
*
*
* @param instanceFamily
* A group of instance types that Savings Plans applies to.
*/
public void setInstanceFamily(String instanceFamily) {
this.instanceFamily = instanceFamily;
}
/**
*
* A group of instance types that Savings Plans applies to.
*
*
* @return A group of instance types that Savings Plans applies to.
*/
public String getInstanceFamily() {
return this.instanceFamily;
}
/**
*
* A group of instance types that Savings Plans applies to.
*
*
* @param instanceFamily
* A group of instance types that Savings Plans applies to.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public SavingsPlansDetails withInstanceFamily(String instanceFamily) {
setInstanceFamily(instanceFamily);
return this;
}
/**
*
* The unique ID that's used to distinguish Savings Plans from one another.
*
*
* @param offeringId
* The unique ID that's used to distinguish Savings Plans from one another.
*/
public void setOfferingId(String offeringId) {
this.offeringId = offeringId;
}
/**
*
* The unique ID that's used to distinguish Savings Plans from one another.
*
*
* @return The unique ID that's used to distinguish Savings Plans from one another.
*/
public String getOfferingId() {
return this.offeringId;
}
/**
*
* The unique ID that's used to distinguish Savings Plans from one another.
*
*
* @param offeringId
* The unique ID that's used to distinguish Savings Plans from one another.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public SavingsPlansDetails withOfferingId(String offeringId) {
setOfferingId(offeringId);
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 (getRegion() != null)
sb.append("Region: ").append(getRegion()).append(",");
if (getInstanceFamily() != null)
sb.append("InstanceFamily: ").append(getInstanceFamily()).append(",");
if (getOfferingId() != null)
sb.append("OfferingId: ").append(getOfferingId());
sb.append("}");
return sb.toString();
}
@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (obj instanceof SavingsPlansDetails == false)
return false;
SavingsPlansDetails other = (SavingsPlansDetails) obj;
if (other.getRegion() == null ^ this.getRegion() == null)
return false;
if (other.getRegion() != null && other.getRegion().equals(this.getRegion()) == false)
return false;
if (other.getInstanceFamily() == null ^ this.getInstanceFamily() == null)
return false;
if (other.getInstanceFamily() != null && other.getInstanceFamily().equals(this.getInstanceFamily()) == false)
return false;
if (other.getOfferingId() == null ^ this.getOfferingId() == null)
return false;
if (other.getOfferingId() != null && other.getOfferingId().equals(this.getOfferingId()) == false)
return false;
return true;
}
@Override
public int hashCode() {
final int prime = 31;
int hashCode = 1;
hashCode = prime * hashCode + ((getRegion() == null) ? 0 : getRegion().hashCode());
hashCode = prime * hashCode + ((getInstanceFamily() == null) ? 0 : getInstanceFamily().hashCode());
hashCode = prime * hashCode + ((getOfferingId() == null) ? 0 : getOfferingId().hashCode());
return hashCode;
}
@Override
public SavingsPlansDetails clone() {
try {
return (SavingsPlansDetails) 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.SavingsPlansDetailsMarshaller.getInstance().marshall(this, protocolMarshaller);
}
}