
com.amazonaws.services.lightsail.model.Domain 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 a domain where you are storing recordsets.
*
*
* @see AWS API
* Documentation
*/
@Generated("com.amazonaws:aws-java-sdk-code-generator")
public class Domain implements Serializable, Cloneable, StructuredPojo {
/**
*
* The name of the domain.
*
*/
private String name;
/**
*
* The Amazon Resource Name (ARN) of the domain recordset (e.g.,
* arn:aws:lightsail:global:123456789101:Domain/824cede0-abc7-4f84-8dbc-12345EXAMPLE
).
*
*/
private String arn;
/**
*
* The support code. Include this code in your email to support when you have questions about an instance or another
* resource in Lightsail. This code enables our support team to look up your Lightsail information more easily.
*
*/
private String supportCode;
/**
*
* The date when the domain recordset was created.
*
*/
private java.util.Date createdAt;
/**
*
* The AWS Region and Availability Zones where the domain recordset was created.
*
*/
private ResourceLocation location;
/**
*
* The resource type.
*
*/
private String resourceType;
/**
*
* 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;
/**
*
* An array of key-value pairs containing information about the domain entries.
*
*/
private java.util.List domainEntries;
/**
*
* An object that describes the state of the Route 53 domain delegation to a Lightsail DNS zone.
*
*/
private RegisteredDomainDelegationInfo registeredDomainDelegationInfo;
/**
*
* The name of the domain.
*
*
* @param name
* The name of the domain.
*/
public void setName(String name) {
this.name = name;
}
/**
*
* The name of the domain.
*
*
* @return The name of the domain.
*/
public String getName() {
return this.name;
}
/**
*
* The name of the domain.
*
*
* @param name
* The name of the domain.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public Domain withName(String name) {
setName(name);
return this;
}
/**
*
* The Amazon Resource Name (ARN) of the domain recordset (e.g.,
* arn:aws:lightsail:global:123456789101:Domain/824cede0-abc7-4f84-8dbc-12345EXAMPLE
).
*
*
* @param arn
* The Amazon Resource Name (ARN) of the domain recordset (e.g.,
* arn:aws:lightsail:global:123456789101:Domain/824cede0-abc7-4f84-8dbc-12345EXAMPLE
).
*/
public void setArn(String arn) {
this.arn = arn;
}
/**
*
* The Amazon Resource Name (ARN) of the domain recordset (e.g.,
* arn:aws:lightsail:global:123456789101:Domain/824cede0-abc7-4f84-8dbc-12345EXAMPLE
).
*
*
* @return The Amazon Resource Name (ARN) of the domain recordset (e.g.,
* arn:aws:lightsail:global:123456789101:Domain/824cede0-abc7-4f84-8dbc-12345EXAMPLE
).
*/
public String getArn() {
return this.arn;
}
/**
*
* The Amazon Resource Name (ARN) of the domain recordset (e.g.,
* arn:aws:lightsail:global:123456789101:Domain/824cede0-abc7-4f84-8dbc-12345EXAMPLE
).
*
*
* @param arn
* The Amazon Resource Name (ARN) of the domain recordset (e.g.,
* arn:aws:lightsail:global:123456789101:Domain/824cede0-abc7-4f84-8dbc-12345EXAMPLE
).
* @return Returns a reference to this object so that method calls can be chained together.
*/
public Domain withArn(String arn) {
setArn(arn);
return this;
}
/**
*
* The support code. Include this code in your email to support when you have questions about an instance or another
* resource in Lightsail. This code enables our support team to look up your Lightsail information more easily.
*
*
* @param supportCode
* The support code. Include this code in your email to support when you have questions about an instance or
* another resource in Lightsail. This code enables our support team to look up your Lightsail information
* more easily.
*/
public void setSupportCode(String supportCode) {
this.supportCode = supportCode;
}
/**
*
* The support code. Include this code in your email to support when you have questions about an instance or another
* resource in Lightsail. This code enables our support team to look up your Lightsail information more easily.
*
*
* @return The support code. Include this code in your email to support when you have questions about an instance or
* another resource in Lightsail. This code enables our support team to look up your Lightsail information
* more easily.
*/
public String getSupportCode() {
return this.supportCode;
}
/**
*
* The support code. Include this code in your email to support when you have questions about an instance or another
* resource in Lightsail. This code enables our support team to look up your Lightsail information more easily.
*
*
* @param supportCode
* The support code. Include this code in your email to support when you have questions about an instance or
* another resource in Lightsail. This code enables our support team to look up your Lightsail information
* more easily.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public Domain withSupportCode(String supportCode) {
setSupportCode(supportCode);
return this;
}
/**
*
* The date when the domain recordset was created.
*
*
* @param createdAt
* The date when the domain recordset was created.
*/
public void setCreatedAt(java.util.Date createdAt) {
this.createdAt = createdAt;
}
/**
*
* The date when the domain recordset was created.
*
*
* @return The date when the domain recordset was created.
*/
public java.util.Date getCreatedAt() {
return this.createdAt;
}
/**
*
* The date when the domain recordset was created.
*
*
* @param createdAt
* The date when the domain recordset was created.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public Domain withCreatedAt(java.util.Date createdAt) {
setCreatedAt(createdAt);
return this;
}
/**
*
* The AWS Region and Availability Zones where the domain recordset was created.
*
*
* @param location
* The AWS Region and Availability Zones where the domain recordset was created.
*/
public void setLocation(ResourceLocation location) {
this.location = location;
}
/**
*
* The AWS Region and Availability Zones where the domain recordset was created.
*
*
* @return The AWS Region and Availability Zones where the domain recordset was created.
*/
public ResourceLocation getLocation() {
return this.location;
}
/**
*
* The AWS Region and Availability Zones where the domain recordset was created.
*
*
* @param location
* The AWS Region and Availability Zones where the domain recordset was created.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public Domain withLocation(ResourceLocation location) {
setLocation(location);
return this;
}
/**
*
* The resource type.
*
*
* @param resourceType
* The resource type.
* @see ResourceType
*/
public void setResourceType(String resourceType) {
this.resourceType = resourceType;
}
/**
*
* The resource type.
*
*
* @return The resource type.
* @see ResourceType
*/
public String getResourceType() {
return this.resourceType;
}
/**
*
* The resource type.
*
*
* @param resourceType
* The resource type.
* @return Returns a reference to this object so that method calls can be chained together.
* @see ResourceType
*/
public Domain withResourceType(String resourceType) {
setResourceType(resourceType);
return this;
}
/**
*
* The resource type.
*
*
* @param resourceType
* The resource type.
* @see ResourceType
*/
public void setResourceType(ResourceType resourceType) {
withResourceType(resourceType);
}
/**
*
* The resource type.
*
*
* @param resourceType
* The resource type.
* @return Returns a reference to this object so that method calls can be chained together.
* @see ResourceType
*/
public Domain withResourceType(ResourceType resourceType) {
this.resourceType = resourceType.toString();
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 Domain 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 Domain withTags(java.util.Collection tags) {
setTags(tags);
return this;
}
/**
*
* An array of key-value pairs containing information about the domain entries.
*
*
* @return An array of key-value pairs containing information about the domain entries.
*/
public java.util.List getDomainEntries() {
return domainEntries;
}
/**
*
* An array of key-value pairs containing information about the domain entries.
*
*
* @param domainEntries
* An array of key-value pairs containing information about the domain entries.
*/
public void setDomainEntries(java.util.Collection domainEntries) {
if (domainEntries == null) {
this.domainEntries = null;
return;
}
this.domainEntries = new java.util.ArrayList(domainEntries);
}
/**
*
* An array of key-value pairs containing information about the domain entries.
*
*
* NOTE: This method appends the values to the existing list (if any). Use
* {@link #setDomainEntries(java.util.Collection)} or {@link #withDomainEntries(java.util.Collection)} if you want
* to override the existing values.
*
*
* @param domainEntries
* An array of key-value pairs containing information about the domain entries.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public Domain withDomainEntries(DomainEntry... domainEntries) {
if (this.domainEntries == null) {
setDomainEntries(new java.util.ArrayList(domainEntries.length));
}
for (DomainEntry ele : domainEntries) {
this.domainEntries.add(ele);
}
return this;
}
/**
*
* An array of key-value pairs containing information about the domain entries.
*
*
* @param domainEntries
* An array of key-value pairs containing information about the domain entries.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public Domain withDomainEntries(java.util.Collection domainEntries) {
setDomainEntries(domainEntries);
return this;
}
/**
*
* An object that describes the state of the Route 53 domain delegation to a Lightsail DNS zone.
*
*
* @param registeredDomainDelegationInfo
* An object that describes the state of the Route 53 domain delegation to a Lightsail DNS zone.
*/
public void setRegisteredDomainDelegationInfo(RegisteredDomainDelegationInfo registeredDomainDelegationInfo) {
this.registeredDomainDelegationInfo = registeredDomainDelegationInfo;
}
/**
*
* An object that describes the state of the Route 53 domain delegation to a Lightsail DNS zone.
*
*
* @return An object that describes the state of the Route 53 domain delegation to a Lightsail DNS zone.
*/
public RegisteredDomainDelegationInfo getRegisteredDomainDelegationInfo() {
return this.registeredDomainDelegationInfo;
}
/**
*
* An object that describes the state of the Route 53 domain delegation to a Lightsail DNS zone.
*
*
* @param registeredDomainDelegationInfo
* An object that describes the state of the Route 53 domain delegation to a Lightsail DNS zone.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public Domain withRegisteredDomainDelegationInfo(RegisteredDomainDelegationInfo registeredDomainDelegationInfo) {
setRegisteredDomainDelegationInfo(registeredDomainDelegationInfo);
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 (getName() != null)
sb.append("Name: ").append(getName()).append(",");
if (getArn() != null)
sb.append("Arn: ").append(getArn()).append(",");
if (getSupportCode() != null)
sb.append("SupportCode: ").append(getSupportCode()).append(",");
if (getCreatedAt() != null)
sb.append("CreatedAt: ").append(getCreatedAt()).append(",");
if (getLocation() != null)
sb.append("Location: ").append(getLocation()).append(",");
if (getResourceType() != null)
sb.append("ResourceType: ").append(getResourceType()).append(",");
if (getTags() != null)
sb.append("Tags: ").append(getTags()).append(",");
if (getDomainEntries() != null)
sb.append("DomainEntries: ").append(getDomainEntries()).append(",");
if (getRegisteredDomainDelegationInfo() != null)
sb.append("RegisteredDomainDelegationInfo: ").append(getRegisteredDomainDelegationInfo());
sb.append("}");
return sb.toString();
}
@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (obj instanceof Domain == false)
return false;
Domain other = (Domain) obj;
if (other.getName() == null ^ this.getName() == null)
return false;
if (other.getName() != null && other.getName().equals(this.getName()) == false)
return false;
if (other.getArn() == null ^ this.getArn() == null)
return false;
if (other.getArn() != null && other.getArn().equals(this.getArn()) == false)
return false;
if (other.getSupportCode() == null ^ this.getSupportCode() == null)
return false;
if (other.getSupportCode() != null && other.getSupportCode().equals(this.getSupportCode()) == false)
return false;
if (other.getCreatedAt() == null ^ this.getCreatedAt() == null)
return false;
if (other.getCreatedAt() != null && other.getCreatedAt().equals(this.getCreatedAt()) == false)
return false;
if (other.getLocation() == null ^ this.getLocation() == null)
return false;
if (other.getLocation() != null && other.getLocation().equals(this.getLocation()) == false)
return false;
if (other.getResourceType() == null ^ this.getResourceType() == null)
return false;
if (other.getResourceType() != null && other.getResourceType().equals(this.getResourceType()) == false)
return false;
if (other.getTags() == null ^ this.getTags() == null)
return false;
if (other.getTags() != null && other.getTags().equals(this.getTags()) == false)
return false;
if (other.getDomainEntries() == null ^ this.getDomainEntries() == null)
return false;
if (other.getDomainEntries() != null && other.getDomainEntries().equals(this.getDomainEntries()) == false)
return false;
if (other.getRegisteredDomainDelegationInfo() == null ^ this.getRegisteredDomainDelegationInfo() == null)
return false;
if (other.getRegisteredDomainDelegationInfo() != null
&& other.getRegisteredDomainDelegationInfo().equals(this.getRegisteredDomainDelegationInfo()) == false)
return false;
return true;
}
@Override
public int hashCode() {
final int prime = 31;
int hashCode = 1;
hashCode = prime * hashCode + ((getName() == null) ? 0 : getName().hashCode());
hashCode = prime * hashCode + ((getArn() == null) ? 0 : getArn().hashCode());
hashCode = prime * hashCode + ((getSupportCode() == null) ? 0 : getSupportCode().hashCode());
hashCode = prime * hashCode + ((getCreatedAt() == null) ? 0 : getCreatedAt().hashCode());
hashCode = prime * hashCode + ((getLocation() == null) ? 0 : getLocation().hashCode());
hashCode = prime * hashCode + ((getResourceType() == null) ? 0 : getResourceType().hashCode());
hashCode = prime * hashCode + ((getTags() == null) ? 0 : getTags().hashCode());
hashCode = prime * hashCode + ((getDomainEntries() == null) ? 0 : getDomainEntries().hashCode());
hashCode = prime * hashCode + ((getRegisteredDomainDelegationInfo() == null) ? 0 : getRegisteredDomainDelegationInfo().hashCode());
return hashCode;
}
@Override
public Domain clone() {
try {
return (Domain) 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.DomainMarshaller.getInstance().marshall(this, protocolMarshaller);
}
}