/* * 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; import com.amazonaws.protocol.StructuredPojo; import com.amazonaws.protocol.ProtocolMarshaller; /** *

* Software license that is managed in License Manager. *

* * @see AWS API * Documentation */ @Generated("com.amazonaws:aws-java-sdk-code-generator") public class License implements Serializable, Cloneable, StructuredPojo { /** *

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

*/ private String licenseArn; /** *

* License name. *

*/ private String licenseName; /** *

* Product name. *

*/ private String productName; /** *

* Product SKU. *

*/ private String productSKU; /** *

* License issuer. *

*/ private IssuerDetails issuer; /** *

* Home Region of the license. *

*/ private String homeRegion; /** *

* License status. *

*/ private String status; /** *

* Date and time range during which the license is valid, in ISO8601-UTC format. *

*/ private DatetimeRange validity; /** *

* License beneficiary. *

*/ private String beneficiary; /** *

* License entitlements. *

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

* Configuration for consumption of the license. *

*/ private ConsumptionConfiguration consumptionConfiguration; /** *

* License metadata. *

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

* License creation time. *

*/ private String createTime; /** *

* License version. *

*/ private String version; /** *

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

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

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

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

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

* * @param licenseArn * Amazon Resource Name (ARN) of the license. * @return Returns a reference to this object so that method calls can be chained together. */ public License withLicenseArn(String licenseArn) { setLicenseArn(licenseArn); return this; } /** *

* License name. *

* * @param licenseName * License name. */ public void setLicenseName(String licenseName) { this.licenseName = licenseName; } /** *

* License name. *

* * @return License name. */ public String getLicenseName() { return this.licenseName; } /** *

* License name. *

* * @param licenseName * License name. * @return Returns a reference to this object so that method calls can be chained together. */ public License withLicenseName(String licenseName) { setLicenseName(licenseName); return this; } /** *

* Product name. *

* * @param productName * Product name. */ public void setProductName(String productName) { this.productName = productName; } /** *

* Product name. *

* * @return Product name. */ public String getProductName() { return this.productName; } /** *

* Product name. *

* * @param productName * Product name. * @return Returns a reference to this object so that method calls can be chained together. */ public License withProductName(String productName) { setProductName(productName); return this; } /** *

* Product SKU. *

* * @param productSKU * Product SKU. */ public void setProductSKU(String productSKU) { this.productSKU = productSKU; } /** *

* Product SKU. *

* * @return Product SKU. */ public String getProductSKU() { return this.productSKU; } /** *

* Product SKU. *

* * @param productSKU * Product SKU. * @return Returns a reference to this object so that method calls can be chained together. */ public License withProductSKU(String productSKU) { setProductSKU(productSKU); return this; } /** *

* License issuer. *

* * @param issuer * License issuer. */ public void setIssuer(IssuerDetails issuer) { this.issuer = issuer; } /** *

* License issuer. *

* * @return License issuer. */ public IssuerDetails getIssuer() { return this.issuer; } /** *

* License issuer. *

* * @param issuer * License issuer. * @return Returns a reference to this object so that method calls can be chained together. */ public License withIssuer(IssuerDetails issuer) { setIssuer(issuer); return this; } /** *

* Home Region of the license. *

* * @param homeRegion * Home Region of the license. */ public void setHomeRegion(String homeRegion) { this.homeRegion = homeRegion; } /** *

* Home Region of the license. *

* * @return Home Region of the license. */ public String getHomeRegion() { return this.homeRegion; } /** *

* Home Region of the license. *

* * @param homeRegion * Home Region of the license. * @return Returns a reference to this object so that method calls can be chained together. */ public License withHomeRegion(String homeRegion) { setHomeRegion(homeRegion); return this; } /** *

* License status. *

* * @param status * License status. * @see LicenseStatus */ public void setStatus(String status) { this.status = status; } /** *

* License status. *

* * @return License status. * @see LicenseStatus */ public String getStatus() { return this.status; } /** *

* License status. *

* * @param status * License status. * @return Returns a reference to this object so that method calls can be chained together. * @see LicenseStatus */ public License withStatus(String status) { setStatus(status); return this; } /** *

* License status. *

* * @param status * License status. * @return Returns a reference to this object so that method calls can be chained together. * @see LicenseStatus */ public License withStatus(LicenseStatus status) { this.status = status.toString(); return this; } /** *

* Date and time range during which the license is valid, in ISO8601-UTC format. *

* * @param validity * Date and time range during which the license is valid, in ISO8601-UTC format. */ public void setValidity(DatetimeRange validity) { this.validity = validity; } /** *

* Date and time range during which the license is valid, in ISO8601-UTC format. *

* * @return Date and time range during which the license is valid, in ISO8601-UTC format. */ public DatetimeRange getValidity() { return this.validity; } /** *

* Date and time range during which the license is valid, in ISO8601-UTC format. *

* * @param validity * Date and time range during which the license is valid, in ISO8601-UTC format. * @return Returns a reference to this object so that method calls can be chained together. */ public License withValidity(DatetimeRange validity) { setValidity(validity); return this; } /** *

* License beneficiary. *

* * @param beneficiary * License beneficiary. */ public void setBeneficiary(String beneficiary) { this.beneficiary = beneficiary; } /** *

* License beneficiary. *

* * @return License beneficiary. */ public String getBeneficiary() { return this.beneficiary; } /** *

* License beneficiary. *

* * @param beneficiary * License beneficiary. * @return Returns a reference to this object so that method calls can be chained together. */ public License withBeneficiary(String beneficiary) { setBeneficiary(beneficiary); return this; } /** *

* License entitlements. *

* * @return License entitlements. */ public java.util.List getEntitlements() { return entitlements; } /** *

* License entitlements. *

* * @param entitlements * License entitlements. */ public void setEntitlements(java.util.Collection entitlements) { if (entitlements == null) { this.entitlements = null; return; } this.entitlements = new java.util.ArrayList(entitlements); } /** *

* License entitlements. *

*

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

* * @param entitlements * License entitlements. * @return Returns a reference to this object so that method calls can be chained together. */ public License withEntitlements(Entitlement... entitlements) { if (this.entitlements == null) { setEntitlements(new java.util.ArrayList(entitlements.length)); } for (Entitlement ele : entitlements) { this.entitlements.add(ele); } return this; } /** *

* License entitlements. *

* * @param entitlements * License entitlements. * @return Returns a reference to this object so that method calls can be chained together. */ public License withEntitlements(java.util.Collection entitlements) { setEntitlements(entitlements); return this; } /** *

* Configuration for consumption of the license. *

* * @param consumptionConfiguration * Configuration for consumption of the license. */ public void setConsumptionConfiguration(ConsumptionConfiguration consumptionConfiguration) { this.consumptionConfiguration = consumptionConfiguration; } /** *

* Configuration for consumption of the license. *

* * @return Configuration for consumption of the license. */ public ConsumptionConfiguration getConsumptionConfiguration() { return this.consumptionConfiguration; } /** *

* Configuration for consumption of the license. *

* * @param consumptionConfiguration * Configuration for consumption of the license. * @return Returns a reference to this object so that method calls can be chained together. */ public License withConsumptionConfiguration(ConsumptionConfiguration consumptionConfiguration) { setConsumptionConfiguration(consumptionConfiguration); return this; } /** *

* License metadata. *

* * @return License metadata. */ public java.util.List getLicenseMetadata() { return licenseMetadata; } /** *

* License metadata. *

* * @param licenseMetadata * License metadata. */ public void setLicenseMetadata(java.util.Collection licenseMetadata) { if (licenseMetadata == null) { this.licenseMetadata = null; return; } this.licenseMetadata = new java.util.ArrayList(licenseMetadata); } /** *

* License metadata. *

*

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

* * @param licenseMetadata * License metadata. * @return Returns a reference to this object so that method calls can be chained together. */ public License withLicenseMetadata(Metadata... licenseMetadata) { if (this.licenseMetadata == null) { setLicenseMetadata(new java.util.ArrayList(licenseMetadata.length)); } for (Metadata ele : licenseMetadata) { this.licenseMetadata.add(ele); } return this; } /** *

* License metadata. *

* * @param licenseMetadata * License metadata. * @return Returns a reference to this object so that method calls can be chained together. */ public License withLicenseMetadata(java.util.Collection licenseMetadata) { setLicenseMetadata(licenseMetadata); return this; } /** *

* License creation time. *

* * @param createTime * License creation time. */ public void setCreateTime(String createTime) { this.createTime = createTime; } /** *

* License creation time. *

* * @return License creation time. */ public String getCreateTime() { return this.createTime; } /** *

* License creation time. *

* * @param createTime * License creation time. * @return Returns a reference to this object so that method calls can be chained together. */ public License withCreateTime(String createTime) { setCreateTime(createTime); return this; } /** *

* License version. *

* * @param version * License version. */ public void setVersion(String version) { this.version = version; } /** *

* License version. *

* * @return License version. */ public String getVersion() { return this.version; } /** *

* License version. *

* * @param version * License version. * @return Returns a reference to this object so that method calls can be chained together. */ public License withVersion(String version) { setVersion(version); 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 (getLicenseArn() != null) sb.append("LicenseArn: ").append(getLicenseArn()).append(","); if (getLicenseName() != null) sb.append("LicenseName: ").append(getLicenseName()).append(","); if (getProductName() != null) sb.append("ProductName: ").append(getProductName()).append(","); if (getProductSKU() != null) sb.append("ProductSKU: ").append(getProductSKU()).append(","); if (getIssuer() != null) sb.append("Issuer: ").append(getIssuer()).append(","); if (getHomeRegion() != null) sb.append("HomeRegion: ").append(getHomeRegion()).append(","); if (getStatus() != null) sb.append("Status: ").append(getStatus()).append(","); if (getValidity() != null) sb.append("Validity: ").append(getValidity()).append(","); if (getBeneficiary() != null) sb.append("Beneficiary: ").append(getBeneficiary()).append(","); if (getEntitlements() != null) sb.append("Entitlements: ").append(getEntitlements()).append(","); if (getConsumptionConfiguration() != null) sb.append("ConsumptionConfiguration: ").append(getConsumptionConfiguration()).append(","); if (getLicenseMetadata() != null) sb.append("LicenseMetadata: ").append(getLicenseMetadata()).append(","); if (getCreateTime() != null) sb.append("CreateTime: ").append(getCreateTime()).append(","); if (getVersion() != null) sb.append("Version: ").append(getVersion()); sb.append("}"); return sb.toString(); } @Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (obj instanceof License == false) return false; License other = (License) obj; if (other.getLicenseArn() == null ^ this.getLicenseArn() == null) return false; if (other.getLicenseArn() != null && other.getLicenseArn().equals(this.getLicenseArn()) == false) return false; if (other.getLicenseName() == null ^ this.getLicenseName() == null) return false; if (other.getLicenseName() != null && other.getLicenseName().equals(this.getLicenseName()) == false) return false; if (other.getProductName() == null ^ this.getProductName() == null) return false; if (other.getProductName() != null && other.getProductName().equals(this.getProductName()) == false) return false; if (other.getProductSKU() == null ^ this.getProductSKU() == null) return false; if (other.getProductSKU() != null && other.getProductSKU().equals(this.getProductSKU()) == false) return false; if (other.getIssuer() == null ^ this.getIssuer() == null) return false; if (other.getIssuer() != null && other.getIssuer().equals(this.getIssuer()) == false) return false; if (other.getHomeRegion() == null ^ this.getHomeRegion() == null) return false; if (other.getHomeRegion() != null && other.getHomeRegion().equals(this.getHomeRegion()) == false) return false; if (other.getStatus() == null ^ this.getStatus() == null) return false; if (other.getStatus() != null && other.getStatus().equals(this.getStatus()) == false) return false; if (other.getValidity() == null ^ this.getValidity() == null) return false; if (other.getValidity() != null && other.getValidity().equals(this.getValidity()) == false) return false; if (other.getBeneficiary() == null ^ this.getBeneficiary() == null) return false; if (other.getBeneficiary() != null && other.getBeneficiary().equals(this.getBeneficiary()) == false) return false; if (other.getEntitlements() == null ^ this.getEntitlements() == null) return false; if (other.getEntitlements() != null && other.getEntitlements().equals(this.getEntitlements()) == false) return false; if (other.getConsumptionConfiguration() == null ^ this.getConsumptionConfiguration() == null) return false; if (other.getConsumptionConfiguration() != null && other.getConsumptionConfiguration().equals(this.getConsumptionConfiguration()) == false) return false; if (other.getLicenseMetadata() == null ^ this.getLicenseMetadata() == null) return false; if (other.getLicenseMetadata() != null && other.getLicenseMetadata().equals(this.getLicenseMetadata()) == false) return false; if (other.getCreateTime() == null ^ this.getCreateTime() == null) return false; if (other.getCreateTime() != null && other.getCreateTime().equals(this.getCreateTime()) == false) return false; if (other.getVersion() == null ^ this.getVersion() == null) return false; if (other.getVersion() != null && other.getVersion().equals(this.getVersion()) == false) return false; return true; } @Override public int hashCode() { final int prime = 31; int hashCode = 1; hashCode = prime * hashCode + ((getLicenseArn() == null) ? 0 : getLicenseArn().hashCode()); hashCode = prime * hashCode + ((getLicenseName() == null) ? 0 : getLicenseName().hashCode()); hashCode = prime * hashCode + ((getProductName() == null) ? 0 : getProductName().hashCode()); hashCode = prime * hashCode + ((getProductSKU() == null) ? 0 : getProductSKU().hashCode()); hashCode = prime * hashCode + ((getIssuer() == null) ? 0 : getIssuer().hashCode()); hashCode = prime * hashCode + ((getHomeRegion() == null) ? 0 : getHomeRegion().hashCode()); hashCode = prime * hashCode + ((getStatus() == null) ? 0 : getStatus().hashCode()); hashCode = prime * hashCode + ((getValidity() == null) ? 0 : getValidity().hashCode()); hashCode = prime * hashCode + ((getBeneficiary() == null) ? 0 : getBeneficiary().hashCode()); hashCode = prime * hashCode + ((getEntitlements() == null) ? 0 : getEntitlements().hashCode()); hashCode = prime * hashCode + ((getConsumptionConfiguration() == null) ? 0 : getConsumptionConfiguration().hashCode()); hashCode = prime * hashCode + ((getLicenseMetadata() == null) ? 0 : getLicenseMetadata().hashCode()); hashCode = prime * hashCode + ((getCreateTime() == null) ? 0 : getCreateTime().hashCode()); hashCode = prime * hashCode + ((getVersion() == null) ? 0 : getVersion().hashCode()); return hashCode; } @Override public License clone() { try { return (License) 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.licensemanager.model.transform.LicenseMarshaller.getInstance().marshall(this, protocolMarshaller); } }