/* * 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.ec2.model; import java.io.Serializable; import javax.annotation.Generated; import com.amazonaws.AmazonWebServiceResult; /** *
* Contains the output of GetReservedInstancesExchangeQuote. *
*/ @Generated("com.amazonaws:aws-java-sdk-code-generator") public class GetReservedInstancesExchangeQuoteResult extends com.amazonaws.AmazonWebServiceResult* The currency of the transaction. *
*/ private String currencyCode; /** *
* If true
, the exchange is valid. If false
, the exchange cannot be completed.
*
* The new end date of the reservation term. *
*/ private java.util.Date outputReservedInstancesWillExpireAt; /** ** The total true upfront charge for the exchange. *
*/ private String paymentDue; /** ** The cost associated with the Reserved Instance. *
*/ private ReservationValue reservedInstanceValueRollup; /** ** The configuration of your Convertible Reserved Instances. *
*/ private com.amazonaws.internal.SdkInternalList* The cost associated with the Reserved Instance. *
*/ private ReservationValue targetConfigurationValueRollup; /** ** The values of the target Convertible Reserved Instances. *
*/ private com.amazonaws.internal.SdkInternalList* Describes the reason why the exchange cannot be completed. *
*/ private String validationFailureReason; /** ** The currency of the transaction. *
* * @param currencyCode * The currency of the transaction. */ public void setCurrencyCode(String currencyCode) { this.currencyCode = currencyCode; } /** ** The currency of the transaction. *
* * @return The currency of the transaction. */ public String getCurrencyCode() { return this.currencyCode; } /** ** The currency of the transaction. *
* * @param currencyCode * The currency of the transaction. * @return Returns a reference to this object so that method calls can be chained together. */ public GetReservedInstancesExchangeQuoteResult withCurrencyCode(String currencyCode) { setCurrencyCode(currencyCode); return this; } /** *
* If true
, the exchange is valid. If false
, the exchange cannot be completed.
*
true
, the exchange is valid. If false
, the exchange cannot be completed.
*/
public void setIsValidExchange(Boolean isValidExchange) {
this.isValidExchange = isValidExchange;
}
/**
*
* If true
, the exchange is valid. If false
, the exchange cannot be completed.
*
true
, the exchange is valid. If false
, the exchange cannot be completed.
*/
public Boolean getIsValidExchange() {
return this.isValidExchange;
}
/**
*
* If true
, the exchange is valid. If false
, the exchange cannot be completed.
*
true
, the exchange is valid. If false
, the exchange cannot be completed.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public GetReservedInstancesExchangeQuoteResult withIsValidExchange(Boolean isValidExchange) {
setIsValidExchange(isValidExchange);
return this;
}
/**
*
* If true
, the exchange is valid. If false
, the exchange cannot be completed.
*
true
, the exchange is valid. If false
, the exchange cannot be completed.
*/
public Boolean isValidExchange() {
return this.isValidExchange;
}
/**
* * The new end date of the reservation term. *
* * @param outputReservedInstancesWillExpireAt * The new end date of the reservation term. */ public void setOutputReservedInstancesWillExpireAt(java.util.Date outputReservedInstancesWillExpireAt) { this.outputReservedInstancesWillExpireAt = outputReservedInstancesWillExpireAt; } /** ** The new end date of the reservation term. *
* * @return The new end date of the reservation term. */ public java.util.Date getOutputReservedInstancesWillExpireAt() { return this.outputReservedInstancesWillExpireAt; } /** ** The new end date of the reservation term. *
* * @param outputReservedInstancesWillExpireAt * The new end date of the reservation term. * @return Returns a reference to this object so that method calls can be chained together. */ public GetReservedInstancesExchangeQuoteResult withOutputReservedInstancesWillExpireAt(java.util.Date outputReservedInstancesWillExpireAt) { setOutputReservedInstancesWillExpireAt(outputReservedInstancesWillExpireAt); return this; } /** ** The total true upfront charge for the exchange. *
* * @param paymentDue * The total true upfront charge for the exchange. */ public void setPaymentDue(String paymentDue) { this.paymentDue = paymentDue; } /** ** The total true upfront charge for the exchange. *
* * @return The total true upfront charge for the exchange. */ public String getPaymentDue() { return this.paymentDue; } /** ** The total true upfront charge for the exchange. *
* * @param paymentDue * The total true upfront charge for the exchange. * @return Returns a reference to this object so that method calls can be chained together. */ public GetReservedInstancesExchangeQuoteResult withPaymentDue(String paymentDue) { setPaymentDue(paymentDue); return this; } /** ** The cost associated with the Reserved Instance. *
* * @param reservedInstanceValueRollup * The cost associated with the Reserved Instance. */ public void setReservedInstanceValueRollup(ReservationValue reservedInstanceValueRollup) { this.reservedInstanceValueRollup = reservedInstanceValueRollup; } /** ** The cost associated with the Reserved Instance. *
* * @return The cost associated with the Reserved Instance. */ public ReservationValue getReservedInstanceValueRollup() { return this.reservedInstanceValueRollup; } /** ** The cost associated with the Reserved Instance. *
* * @param reservedInstanceValueRollup * The cost associated with the Reserved Instance. * @return Returns a reference to this object so that method calls can be chained together. */ public GetReservedInstancesExchangeQuoteResult withReservedInstanceValueRollup(ReservationValue reservedInstanceValueRollup) { setReservedInstanceValueRollup(reservedInstanceValueRollup); return this; } /** ** The configuration of your Convertible Reserved Instances. *
* * @return The configuration of your Convertible Reserved Instances. */ public java.util.List* The configuration of your Convertible Reserved Instances. *
* * @param reservedInstanceValueSet * The configuration of your Convertible Reserved Instances. */ public void setReservedInstanceValueSet(java.util.Collection* The configuration of your Convertible Reserved Instances. *
** NOTE: This method appends the values to the existing list (if any). Use * {@link #setReservedInstanceValueSet(java.util.Collection)} or * {@link #withReservedInstanceValueSet(java.util.Collection)} if you want to override the existing values. *
* * @param reservedInstanceValueSet * The configuration of your Convertible Reserved Instances. * @return Returns a reference to this object so that method calls can be chained together. */ public GetReservedInstancesExchangeQuoteResult withReservedInstanceValueSet(ReservedInstanceReservationValue... reservedInstanceValueSet) { if (this.reservedInstanceValueSet == null) { setReservedInstanceValueSet(new com.amazonaws.internal.SdkInternalList* The configuration of your Convertible Reserved Instances. *
* * @param reservedInstanceValueSet * The configuration of your Convertible Reserved Instances. * @return Returns a reference to this object so that method calls can be chained together. */ public GetReservedInstancesExchangeQuoteResult withReservedInstanceValueSet(java.util.Collection* The cost associated with the Reserved Instance. *
* * @param targetConfigurationValueRollup * The cost associated with the Reserved Instance. */ public void setTargetConfigurationValueRollup(ReservationValue targetConfigurationValueRollup) { this.targetConfigurationValueRollup = targetConfigurationValueRollup; } /** ** The cost associated with the Reserved Instance. *
* * @return The cost associated with the Reserved Instance. */ public ReservationValue getTargetConfigurationValueRollup() { return this.targetConfigurationValueRollup; } /** ** The cost associated with the Reserved Instance. *
* * @param targetConfigurationValueRollup * The cost associated with the Reserved Instance. * @return Returns a reference to this object so that method calls can be chained together. */ public GetReservedInstancesExchangeQuoteResult withTargetConfigurationValueRollup(ReservationValue targetConfigurationValueRollup) { setTargetConfigurationValueRollup(targetConfigurationValueRollup); return this; } /** ** The values of the target Convertible Reserved Instances. *
* * @return The values of the target Convertible Reserved Instances. */ public java.util.List* The values of the target Convertible Reserved Instances. *
* * @param targetConfigurationValueSet * The values of the target Convertible Reserved Instances. */ public void setTargetConfigurationValueSet(java.util.Collection* The values of the target Convertible Reserved Instances. *
** NOTE: This method appends the values to the existing list (if any). Use * {@link #setTargetConfigurationValueSet(java.util.Collection)} or * {@link #withTargetConfigurationValueSet(java.util.Collection)} if you want to override the existing values. *
* * @param targetConfigurationValueSet * The values of the target Convertible Reserved Instances. * @return Returns a reference to this object so that method calls can be chained together. */ public GetReservedInstancesExchangeQuoteResult withTargetConfigurationValueSet(TargetReservationValue... targetConfigurationValueSet) { if (this.targetConfigurationValueSet == null) { setTargetConfigurationValueSet(new com.amazonaws.internal.SdkInternalList* The values of the target Convertible Reserved Instances. *
* * @param targetConfigurationValueSet * The values of the target Convertible Reserved Instances. * @return Returns a reference to this object so that method calls can be chained together. */ public GetReservedInstancesExchangeQuoteResult withTargetConfigurationValueSet(java.util.Collection* Describes the reason why the exchange cannot be completed. *
* * @param validationFailureReason * Describes the reason why the exchange cannot be completed. */ public void setValidationFailureReason(String validationFailureReason) { this.validationFailureReason = validationFailureReason; } /** ** Describes the reason why the exchange cannot be completed. *
* * @return Describes the reason why the exchange cannot be completed. */ public String getValidationFailureReason() { return this.validationFailureReason; } /** ** Describes the reason why the exchange cannot be completed. *
* * @param validationFailureReason * Describes the reason why the exchange cannot be completed. * @return Returns a reference to this object so that method calls can be chained together. */ public GetReservedInstancesExchangeQuoteResult withValidationFailureReason(String validationFailureReason) { setValidationFailureReason(validationFailureReason); 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 (getCurrencyCode() != null) sb.append("CurrencyCode: ").append(getCurrencyCode()).append(","); if (getIsValidExchange() != null) sb.append("IsValidExchange: ").append(getIsValidExchange()).append(","); if (getOutputReservedInstancesWillExpireAt() != null) sb.append("OutputReservedInstancesWillExpireAt: ").append(getOutputReservedInstancesWillExpireAt()).append(","); if (getPaymentDue() != null) sb.append("PaymentDue: ").append(getPaymentDue()).append(","); if (getReservedInstanceValueRollup() != null) sb.append("ReservedInstanceValueRollup: ").append(getReservedInstanceValueRollup()).append(","); if (getReservedInstanceValueSet() != null) sb.append("ReservedInstanceValueSet: ").append(getReservedInstanceValueSet()).append(","); if (getTargetConfigurationValueRollup() != null) sb.append("TargetConfigurationValueRollup: ").append(getTargetConfigurationValueRollup()).append(","); if (getTargetConfigurationValueSet() != null) sb.append("TargetConfigurationValueSet: ").append(getTargetConfigurationValueSet()).append(","); if (getValidationFailureReason() != null) sb.append("ValidationFailureReason: ").append(getValidationFailureReason()); sb.append("}"); return sb.toString(); } @Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (obj instanceof GetReservedInstancesExchangeQuoteResult == false) return false; GetReservedInstancesExchangeQuoteResult other = (GetReservedInstancesExchangeQuoteResult) obj; if (other.getCurrencyCode() == null ^ this.getCurrencyCode() == null) return false; if (other.getCurrencyCode() != null && other.getCurrencyCode().equals(this.getCurrencyCode()) == false) return false; if (other.getIsValidExchange() == null ^ this.getIsValidExchange() == null) return false; if (other.getIsValidExchange() != null && other.getIsValidExchange().equals(this.getIsValidExchange()) == false) return false; if (other.getOutputReservedInstancesWillExpireAt() == null ^ this.getOutputReservedInstancesWillExpireAt() == null) return false; if (other.getOutputReservedInstancesWillExpireAt() != null && other.getOutputReservedInstancesWillExpireAt().equals(this.getOutputReservedInstancesWillExpireAt()) == false) return false; if (other.getPaymentDue() == null ^ this.getPaymentDue() == null) return false; if (other.getPaymentDue() != null && other.getPaymentDue().equals(this.getPaymentDue()) == false) return false; if (other.getReservedInstanceValueRollup() == null ^ this.getReservedInstanceValueRollup() == null) return false; if (other.getReservedInstanceValueRollup() != null && other.getReservedInstanceValueRollup().equals(this.getReservedInstanceValueRollup()) == false) return false; if (other.getReservedInstanceValueSet() == null ^ this.getReservedInstanceValueSet() == null) return false; if (other.getReservedInstanceValueSet() != null && other.getReservedInstanceValueSet().equals(this.getReservedInstanceValueSet()) == false) return false; if (other.getTargetConfigurationValueRollup() == null ^ this.getTargetConfigurationValueRollup() == null) return false; if (other.getTargetConfigurationValueRollup() != null && other.getTargetConfigurationValueRollup().equals(this.getTargetConfigurationValueRollup()) == false) return false; if (other.getTargetConfigurationValueSet() == null ^ this.getTargetConfigurationValueSet() == null) return false; if (other.getTargetConfigurationValueSet() != null && other.getTargetConfigurationValueSet().equals(this.getTargetConfigurationValueSet()) == false) return false; if (other.getValidationFailureReason() == null ^ this.getValidationFailureReason() == null) return false; if (other.getValidationFailureReason() != null && other.getValidationFailureReason().equals(this.getValidationFailureReason()) == false) return false; return true; } @Override public int hashCode() { final int prime = 31; int hashCode = 1; hashCode = prime * hashCode + ((getCurrencyCode() == null) ? 0 : getCurrencyCode().hashCode()); hashCode = prime * hashCode + ((getIsValidExchange() == null) ? 0 : getIsValidExchange().hashCode()); hashCode = prime * hashCode + ((getOutputReservedInstancesWillExpireAt() == null) ? 0 : getOutputReservedInstancesWillExpireAt().hashCode()); hashCode = prime * hashCode + ((getPaymentDue() == null) ? 0 : getPaymentDue().hashCode()); hashCode = prime * hashCode + ((getReservedInstanceValueRollup() == null) ? 0 : getReservedInstanceValueRollup().hashCode()); hashCode = prime * hashCode + ((getReservedInstanceValueSet() == null) ? 0 : getReservedInstanceValueSet().hashCode()); hashCode = prime * hashCode + ((getTargetConfigurationValueRollup() == null) ? 0 : getTargetConfigurationValueRollup().hashCode()); hashCode = prime * hashCode + ((getTargetConfigurationValueSet() == null) ? 0 : getTargetConfigurationValueSet().hashCode()); hashCode = prime * hashCode + ((getValidationFailureReason() == null) ? 0 : getValidationFailureReason().hashCode()); return hashCode; } @Override public GetReservedInstancesExchangeQuoteResult clone() { try { return (GetReservedInstancesExchangeQuoteResult) super.clone(); } catch (CloneNotSupportedException e) { throw new IllegalStateException("Got a CloneNotSupportedException from Object.clone() " + "even though we're Cloneable!", e); } } }