/* * 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.licensemanager.model; import java.io.Serializable; import javax.annotation.Generated; /** * * @see AWS * API Documentation */ @Generated("com.amazonaws:aws-java-sdk-code-generator") public class CheckoutLicenseResult extends com.amazonaws.AmazonWebServiceResult implements Serializable, Cloneable { /** *

* Checkout type. *

*/ private String checkoutType; /** *

* License consumption token. *

*/ private String licenseConsumptionToken; /** *

* Allowed license entitlements. *

*/ private java.util.List entitlementsAllowed; /** *

* Signed token. *

*/ private String signedToken; /** *

* Node ID. *

*/ private String nodeId; /** *

* Date and time at which the license checkout is issued. *

*/ private String issuedAt; /** *

* Date and time at which the license checkout expires. *

*/ private String expiration; /** *

* Amazon Resource Name (ARN) of the checkout license. *

*/ private String licenseArn; /** *

* Checkout type. *

* * @param checkoutType * Checkout type. * @see CheckoutType */ public void setCheckoutType(String checkoutType) { this.checkoutType = checkoutType; } /** *

* Checkout type. *

* * @return Checkout type. * @see CheckoutType */ public String getCheckoutType() { return this.checkoutType; } /** *

* Checkout type. *

* * @param checkoutType * Checkout type. * @return Returns a reference to this object so that method calls can be chained together. * @see CheckoutType */ public CheckoutLicenseResult withCheckoutType(String checkoutType) { setCheckoutType(checkoutType); return this; } /** *

* Checkout type. *

* * @param checkoutType * Checkout type. * @return Returns a reference to this object so that method calls can be chained together. * @see CheckoutType */ public CheckoutLicenseResult withCheckoutType(CheckoutType checkoutType) { this.checkoutType = checkoutType.toString(); return this; } /** *

* License consumption token. *

* * @param licenseConsumptionToken * License consumption token. */ public void setLicenseConsumptionToken(String licenseConsumptionToken) { this.licenseConsumptionToken = licenseConsumptionToken; } /** *

* License consumption token. *

* * @return License consumption token. */ public String getLicenseConsumptionToken() { return this.licenseConsumptionToken; } /** *

* License consumption token. *

* * @param licenseConsumptionToken * License consumption token. * @return Returns a reference to this object so that method calls can be chained together. */ public CheckoutLicenseResult withLicenseConsumptionToken(String licenseConsumptionToken) { setLicenseConsumptionToken(licenseConsumptionToken); return this; } /** *

* Allowed license entitlements. *

* * @return Allowed license entitlements. */ public java.util.List getEntitlementsAllowed() { return entitlementsAllowed; } /** *

* Allowed license entitlements. *

* * @param entitlementsAllowed * Allowed license entitlements. */ public void setEntitlementsAllowed(java.util.Collection entitlementsAllowed) { if (entitlementsAllowed == null) { this.entitlementsAllowed = null; return; } this.entitlementsAllowed = new java.util.ArrayList(entitlementsAllowed); } /** *

* Allowed license entitlements. *

*

* NOTE: This method appends the values to the existing list (if any). Use * {@link #setEntitlementsAllowed(java.util.Collection)} or {@link #withEntitlementsAllowed(java.util.Collection)} * if you want to override the existing values. *

* * @param entitlementsAllowed * Allowed license entitlements. * @return Returns a reference to this object so that method calls can be chained together. */ public CheckoutLicenseResult withEntitlementsAllowed(EntitlementData... entitlementsAllowed) { if (this.entitlementsAllowed == null) { setEntitlementsAllowed(new java.util.ArrayList(entitlementsAllowed.length)); } for (EntitlementData ele : entitlementsAllowed) { this.entitlementsAllowed.add(ele); } return this; } /** *

* Allowed license entitlements. *

* * @param entitlementsAllowed * Allowed license entitlements. * @return Returns a reference to this object so that method calls can be chained together. */ public CheckoutLicenseResult withEntitlementsAllowed(java.util.Collection entitlementsAllowed) { setEntitlementsAllowed(entitlementsAllowed); return this; } /** *

* Signed token. *

* * @param signedToken * Signed token. */ public void setSignedToken(String signedToken) { this.signedToken = signedToken; } /** *

* Signed token. *

* * @return Signed token. */ public String getSignedToken() { return this.signedToken; } /** *

* Signed token. *

* * @param signedToken * Signed token. * @return Returns a reference to this object so that method calls can be chained together. */ public CheckoutLicenseResult withSignedToken(String signedToken) { setSignedToken(signedToken); return this; } /** *

* Node ID. *

* * @param nodeId * Node ID. */ public void setNodeId(String nodeId) { this.nodeId = nodeId; } /** *

* Node ID. *

* * @return Node ID. */ public String getNodeId() { return this.nodeId; } /** *

* Node ID. *

* * @param nodeId * Node ID. * @return Returns a reference to this object so that method calls can be chained together. */ public CheckoutLicenseResult withNodeId(String nodeId) { setNodeId(nodeId); return this; } /** *

* Date and time at which the license checkout is issued. *

* * @param issuedAt * Date and time at which the license checkout is issued. */ public void setIssuedAt(String issuedAt) { this.issuedAt = issuedAt; } /** *

* Date and time at which the license checkout is issued. *

* * @return Date and time at which the license checkout is issued. */ public String getIssuedAt() { return this.issuedAt; } /** *

* Date and time at which the license checkout is issued. *

* * @param issuedAt * Date and time at which the license checkout is issued. * @return Returns a reference to this object so that method calls can be chained together. */ public CheckoutLicenseResult withIssuedAt(String issuedAt) { setIssuedAt(issuedAt); return this; } /** *

* Date and time at which the license checkout expires. *

* * @param expiration * Date and time at which the license checkout expires. */ public void setExpiration(String expiration) { this.expiration = expiration; } /** *

* Date and time at which the license checkout expires. *

* * @return Date and time at which the license checkout expires. */ public String getExpiration() { return this.expiration; } /** *

* Date and time at which the license checkout expires. *

* * @param expiration * Date and time at which the license checkout expires. * @return Returns a reference to this object so that method calls can be chained together. */ public CheckoutLicenseResult withExpiration(String expiration) { setExpiration(expiration); return this; } /** *

* Amazon Resource Name (ARN) of the checkout license. *

* * @param licenseArn * Amazon Resource Name (ARN) of the checkout license. */ public void setLicenseArn(String licenseArn) { this.licenseArn = licenseArn; } /** *

* Amazon Resource Name (ARN) of the checkout license. *

* * @return Amazon Resource Name (ARN) of the checkout license. */ public String getLicenseArn() { return this.licenseArn; } /** *

* Amazon Resource Name (ARN) of the checkout license. *

* * @param licenseArn * Amazon Resource Name (ARN) of the checkout license. * @return Returns a reference to this object so that method calls can be chained together. */ public CheckoutLicenseResult withLicenseArn(String licenseArn) { setLicenseArn(licenseArn); 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 (getCheckoutType() != null) sb.append("CheckoutType: ").append(getCheckoutType()).append(","); if (getLicenseConsumptionToken() != null) sb.append("LicenseConsumptionToken: ").append(getLicenseConsumptionToken()).append(","); if (getEntitlementsAllowed() != null) sb.append("EntitlementsAllowed: ").append(getEntitlementsAllowed()).append(","); if (getSignedToken() != null) sb.append("SignedToken: ").append(getSignedToken()).append(","); if (getNodeId() != null) sb.append("NodeId: ").append(getNodeId()).append(","); if (getIssuedAt() != null) sb.append("IssuedAt: ").append(getIssuedAt()).append(","); if (getExpiration() != null) sb.append("Expiration: ").append(getExpiration()).append(","); if (getLicenseArn() != null) sb.append("LicenseArn: ").append(getLicenseArn()); sb.append("}"); return sb.toString(); } @Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (obj instanceof CheckoutLicenseResult == false) return false; CheckoutLicenseResult other = (CheckoutLicenseResult) obj; if (other.getCheckoutType() == null ^ this.getCheckoutType() == null) return false; if (other.getCheckoutType() != null && other.getCheckoutType().equals(this.getCheckoutType()) == false) return false; if (other.getLicenseConsumptionToken() == null ^ this.getLicenseConsumptionToken() == null) return false; if (other.getLicenseConsumptionToken() != null && other.getLicenseConsumptionToken().equals(this.getLicenseConsumptionToken()) == false) return false; if (other.getEntitlementsAllowed() == null ^ this.getEntitlementsAllowed() == null) return false; if (other.getEntitlementsAllowed() != null && other.getEntitlementsAllowed().equals(this.getEntitlementsAllowed()) == false) return false; if (other.getSignedToken() == null ^ this.getSignedToken() == null) return false; if (other.getSignedToken() != null && other.getSignedToken().equals(this.getSignedToken()) == false) return false; if (other.getNodeId() == null ^ this.getNodeId() == null) return false; if (other.getNodeId() != null && other.getNodeId().equals(this.getNodeId()) == false) return false; if (other.getIssuedAt() == null ^ this.getIssuedAt() == null) return false; if (other.getIssuedAt() != null && other.getIssuedAt().equals(this.getIssuedAt()) == false) return false; if (other.getExpiration() == null ^ this.getExpiration() == null) return false; if (other.getExpiration() != null && other.getExpiration().equals(this.getExpiration()) == false) return false; if (other.getLicenseArn() == null ^ this.getLicenseArn() == null) return false; if (other.getLicenseArn() != null && other.getLicenseArn().equals(this.getLicenseArn()) == false) return false; return true; } @Override public int hashCode() { final int prime = 31; int hashCode = 1; hashCode = prime * hashCode + ((getCheckoutType() == null) ? 0 : getCheckoutType().hashCode()); hashCode = prime * hashCode + ((getLicenseConsumptionToken() == null) ? 0 : getLicenseConsumptionToken().hashCode()); hashCode = prime * hashCode + ((getEntitlementsAllowed() == null) ? 0 : getEntitlementsAllowed().hashCode()); hashCode = prime * hashCode + ((getSignedToken() == null) ? 0 : getSignedToken().hashCode()); hashCode = prime * hashCode + ((getNodeId() == null) ? 0 : getNodeId().hashCode()); hashCode = prime * hashCode + ((getIssuedAt() == null) ? 0 : getIssuedAt().hashCode()); hashCode = prime * hashCode + ((getExpiration() == null) ? 0 : getExpiration().hashCode()); hashCode = prime * hashCode + ((getLicenseArn() == null) ? 0 : getLicenseArn().hashCode()); return hashCode; } @Override public CheckoutLicenseResult clone() { try { return (CheckoutLicenseResult) super.clone(); } catch (CloneNotSupportedException e) { throw new IllegalStateException("Got a CloneNotSupportedException from Object.clone() " + "even though we're Cloneable!", e); } } }