
com.amazonaws.services.lightsail.model.CertificateSummary Maven / Gradle / Ivy
/*
* 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.lightsail.model;
import java.io.Serializable;
import javax.annotation.Generated;
import com.amazonaws.protocol.StructuredPojo;
import com.amazonaws.protocol.ProtocolMarshaller;
/**
*
* Describes an Amazon Lightsail SSL/TLS certificate.
*
*
* @see AWS API
* Documentation
*/
@Generated("com.amazonaws:aws-java-sdk-code-generator")
public class CertificateSummary implements Serializable, Cloneable, StructuredPojo {
/**
*
* The Amazon Resource Name (ARN) of the certificate.
*
*/
private String certificateArn;
/**
*
* The name of the certificate.
*
*/
private String certificateName;
/**
*
* The domain name of the certificate.
*
*/
private String domainName;
/**
*
* An object that describes a certificate in detail.
*
*/
private Certificate certificateDetail;
/**
*
* The tag keys and optional values for the resource. For more information about tags in Lightsail, see the Amazon Lightsail Developer
* Guide.
*
*/
private java.util.List tags;
/**
*
* The Amazon Resource Name (ARN) of the certificate.
*
*
* @param certificateArn
* The Amazon Resource Name (ARN) of the certificate.
*/
public void setCertificateArn(String certificateArn) {
this.certificateArn = certificateArn;
}
/**
*
* The Amazon Resource Name (ARN) of the certificate.
*
*
* @return The Amazon Resource Name (ARN) of the certificate.
*/
public String getCertificateArn() {
return this.certificateArn;
}
/**
*
* The Amazon Resource Name (ARN) of the certificate.
*
*
* @param certificateArn
* The Amazon Resource Name (ARN) of the certificate.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public CertificateSummary withCertificateArn(String certificateArn) {
setCertificateArn(certificateArn);
return this;
}
/**
*
* The name of the certificate.
*
*
* @param certificateName
* The name of the certificate.
*/
public void setCertificateName(String certificateName) {
this.certificateName = certificateName;
}
/**
*
* The name of the certificate.
*
*
* @return The name of the certificate.
*/
public String getCertificateName() {
return this.certificateName;
}
/**
*
* The name of the certificate.
*
*
* @param certificateName
* The name of the certificate.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public CertificateSummary withCertificateName(String certificateName) {
setCertificateName(certificateName);
return this;
}
/**
*
* The domain name of the certificate.
*
*
* @param domainName
* The domain name of the certificate.
*/
public void setDomainName(String domainName) {
this.domainName = domainName;
}
/**
*
* The domain name of the certificate.
*
*
* @return The domain name of the certificate.
*/
public String getDomainName() {
return this.domainName;
}
/**
*
* The domain name of the certificate.
*
*
* @param domainName
* The domain name of the certificate.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public CertificateSummary withDomainName(String domainName) {
setDomainName(domainName);
return this;
}
/**
*
* An object that describes a certificate in detail.
*
*
* @param certificateDetail
* An object that describes a certificate in detail.
*/
public void setCertificateDetail(Certificate certificateDetail) {
this.certificateDetail = certificateDetail;
}
/**
*
* An object that describes a certificate in detail.
*
*
* @return An object that describes a certificate in detail.
*/
public Certificate getCertificateDetail() {
return this.certificateDetail;
}
/**
*
* An object that describes a certificate in detail.
*
*
* @param certificateDetail
* An object that describes a certificate in detail.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public CertificateSummary withCertificateDetail(Certificate certificateDetail) {
setCertificateDetail(certificateDetail);
return this;
}
/**
*
* The tag keys and optional values for the resource. For more information about tags in Lightsail, see the Amazon Lightsail Developer
* Guide.
*
*
* @return The tag keys and optional values for the resource. For more information about tags in Lightsail, see the
* Amazon Lightsail
* Developer Guide.
*/
public java.util.List getTags() {
return tags;
}
/**
*
* The tag keys and optional values for the resource. For more information about tags in Lightsail, see the Amazon Lightsail Developer
* Guide.
*
*
* @param tags
* The tag keys and optional values for the resource. For more information about tags in Lightsail, see the
* Amazon Lightsail
* Developer Guide.
*/
public void setTags(java.util.Collection tags) {
if (tags == null) {
this.tags = null;
return;
}
this.tags = new java.util.ArrayList(tags);
}
/**
*
* The tag keys and optional values for the resource. For more information about tags in Lightsail, see the Amazon Lightsail Developer
* Guide.
*
*
* NOTE: This method appends the values to the existing list (if any). Use
* {@link #setTags(java.util.Collection)} or {@link #withTags(java.util.Collection)} if you want to override the
* existing values.
*
*
* @param tags
* The tag keys and optional values for the resource. For more information about tags in Lightsail, see the
* Amazon Lightsail
* Developer Guide.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public CertificateSummary withTags(Tag... tags) {
if (this.tags == null) {
setTags(new java.util.ArrayList(tags.length));
}
for (Tag ele : tags) {
this.tags.add(ele);
}
return this;
}
/**
*
* The tag keys and optional values for the resource. For more information about tags in Lightsail, see the Amazon Lightsail Developer
* Guide.
*
*
* @param tags
* The tag keys and optional values for the resource. For more information about tags in Lightsail, see the
* Amazon Lightsail
* Developer Guide.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public CertificateSummary withTags(java.util.Collection tags) {
setTags(tags);
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 (getCertificateArn() != null)
sb.append("CertificateArn: ").append(getCertificateArn()).append(",");
if (getCertificateName() != null)
sb.append("CertificateName: ").append(getCertificateName()).append(",");
if (getDomainName() != null)
sb.append("DomainName: ").append(getDomainName()).append(",");
if (getCertificateDetail() != null)
sb.append("CertificateDetail: ").append(getCertificateDetail()).append(",");
if (getTags() != null)
sb.append("Tags: ").append(getTags());
sb.append("}");
return sb.toString();
}
@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (obj instanceof CertificateSummary == false)
return false;
CertificateSummary other = (CertificateSummary) obj;
if (other.getCertificateArn() == null ^ this.getCertificateArn() == null)
return false;
if (other.getCertificateArn() != null && other.getCertificateArn().equals(this.getCertificateArn()) == false)
return false;
if (other.getCertificateName() == null ^ this.getCertificateName() == null)
return false;
if (other.getCertificateName() != null && other.getCertificateName().equals(this.getCertificateName()) == false)
return false;
if (other.getDomainName() == null ^ this.getDomainName() == null)
return false;
if (other.getDomainName() != null && other.getDomainName().equals(this.getDomainName()) == false)
return false;
if (other.getCertificateDetail() == null ^ this.getCertificateDetail() == null)
return false;
if (other.getCertificateDetail() != null && other.getCertificateDetail().equals(this.getCertificateDetail()) == false)
return false;
if (other.getTags() == null ^ this.getTags() == null)
return false;
if (other.getTags() != null && other.getTags().equals(this.getTags()) == false)
return false;
return true;
}
@Override
public int hashCode() {
final int prime = 31;
int hashCode = 1;
hashCode = prime * hashCode + ((getCertificateArn() == null) ? 0 : getCertificateArn().hashCode());
hashCode = prime * hashCode + ((getCertificateName() == null) ? 0 : getCertificateName().hashCode());
hashCode = prime * hashCode + ((getDomainName() == null) ? 0 : getDomainName().hashCode());
hashCode = prime * hashCode + ((getCertificateDetail() == null) ? 0 : getCertificateDetail().hashCode());
hashCode = prime * hashCode + ((getTags() == null) ? 0 : getTags().hashCode());
return hashCode;
}
@Override
public CertificateSummary clone() {
try {
return (CertificateSummary) 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.lightsail.model.transform.CertificateSummaryMarshaller.getInstance().marshall(this, protocolMarshaller);
}
}