
com.amazonaws.services.route53domains.model.Nameserver Maven / Gradle / Ivy
Show all versions of aws-java-sdk-route53 Show documentation
/*
* Copyright 2010-2016 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.route53domains.model;
import java.io.Serializable;
/**
*
* Nameserver includes the following elements.
*
*/
public class Nameserver implements Serializable, Cloneable {
/**
*
* The fully qualified host name of the name server.
*
*
* Type: String
*
*
* Constraint: Maximum 255 characterss
*
*
* Parent: Nameservers
*
*/
private String name;
/**
*
* Glue IP address of a name server entry. Glue IP addresses are required
* only when the name of the name server is a subdomain of the domain. For
* example, if your domain is example.com and the name server for the domain
* is ns.example.com, you need to specify the IP address for ns.example.com.
*
*
* Type: List of IP addresses.
*
*
* Constraints: The list can contain only one IPv4 and one IPv6 address.
*
*
* Parent: Nameservers
*
*/
private com.amazonaws.internal.SdkInternalList glueIps;
/**
*
* The fully qualified host name of the name server.
*
*
* Type: String
*
*
* Constraint: Maximum 255 characterss
*
*
* Parent: Nameservers
*
*
* @param name
* The fully qualified host name of the name server.
*
* Type: String
*
*
* Constraint: Maximum 255 characterss
*
*
* Parent: Nameservers
*/
public void setName(String name) {
this.name = name;
}
/**
*
* The fully qualified host name of the name server.
*
*
* Type: String
*
*
* Constraint: Maximum 255 characterss
*
*
* Parent: Nameservers
*
*
* @return The fully qualified host name of the name server.
*
* Type: String
*
*
* Constraint: Maximum 255 characterss
*
*
* Parent: Nameservers
*/
public String getName() {
return this.name;
}
/**
*
* The fully qualified host name of the name server.
*
*
* Type: String
*
*
* Constraint: Maximum 255 characterss
*
*
* Parent: Nameservers
*
*
* @param name
* The fully qualified host name of the name server.
*
* Type: String
*
*
* Constraint: Maximum 255 characterss
*
*
* Parent: Nameservers
* @return Returns a reference to this object so that method calls can be
* chained together.
*/
public Nameserver withName(String name) {
setName(name);
return this;
}
/**
*
* Glue IP address of a name server entry. Glue IP addresses are required
* only when the name of the name server is a subdomain of the domain. For
* example, if your domain is example.com and the name server for the domain
* is ns.example.com, you need to specify the IP address for ns.example.com.
*
*
* Type: List of IP addresses.
*
*
* Constraints: The list can contain only one IPv4 and one IPv6 address.
*
*
* Parent: Nameservers
*
*
* @return Glue IP address of a name server entry. Glue IP addresses are
* required only when the name of the name server is a subdomain of
* the domain. For example, if your domain is example.com and the
* name server for the domain is ns.example.com, you need to specify
* the IP address for ns.example.com.
*
* Type: List of IP addresses.
*
*
* Constraints: The list can contain only one IPv4 and one IPv6
* address.
*
*
* Parent: Nameservers
*/
public java.util.List getGlueIps() {
if (glueIps == null) {
glueIps = new com.amazonaws.internal.SdkInternalList();
}
return glueIps;
}
/**
*
* Glue IP address of a name server entry. Glue IP addresses are required
* only when the name of the name server is a subdomain of the domain. For
* example, if your domain is example.com and the name server for the domain
* is ns.example.com, you need to specify the IP address for ns.example.com.
*
*
* Type: List of IP addresses.
*
*
* Constraints: The list can contain only one IPv4 and one IPv6 address.
*
*
* Parent: Nameservers
*
*
* @param glueIps
* Glue IP address of a name server entry. Glue IP addresses are
* required only when the name of the name server is a subdomain of
* the domain. For example, if your domain is example.com and the
* name server for the domain is ns.example.com, you need to specify
* the IP address for ns.example.com.
*
* Type: List of IP addresses.
*
*
* Constraints: The list can contain only one IPv4 and one IPv6
* address.
*
*
* Parent: Nameservers
*/
public void setGlueIps(java.util.Collection glueIps) {
if (glueIps == null) {
this.glueIps = null;
return;
}
this.glueIps = new com.amazonaws.internal.SdkInternalList(
glueIps);
}
/**
*
* Glue IP address of a name server entry. Glue IP addresses are required
* only when the name of the name server is a subdomain of the domain. For
* example, if your domain is example.com and the name server for the domain
* is ns.example.com, you need to specify the IP address for ns.example.com.
*
*
* Type: List of IP addresses.
*
*
* Constraints: The list can contain only one IPv4 and one IPv6 address.
*
*
* Parent: Nameservers
*
*
* NOTE: This method appends the values to the existing list (if
* any). Use {@link #setGlueIps(java.util.Collection)} or
* {@link #withGlueIps(java.util.Collection)} if you want to override the
* existing values.
*
*
* @param glueIps
* Glue IP address of a name server entry. Glue IP addresses are
* required only when the name of the name server is a subdomain of
* the domain. For example, if your domain is example.com and the
* name server for the domain is ns.example.com, you need to specify
* the IP address for ns.example.com.
*
* Type: List of IP addresses.
*
*
* Constraints: The list can contain only one IPv4 and one IPv6
* address.
*
*
* Parent: Nameservers
* @return Returns a reference to this object so that method calls can be
* chained together.
*/
public Nameserver withGlueIps(String... glueIps) {
if (this.glueIps == null) {
setGlueIps(new com.amazonaws.internal.SdkInternalList(
glueIps.length));
}
for (String ele : glueIps) {
this.glueIps.add(ele);
}
return this;
}
/**
*
* Glue IP address of a name server entry. Glue IP addresses are required
* only when the name of the name server is a subdomain of the domain. For
* example, if your domain is example.com and the name server for the domain
* is ns.example.com, you need to specify the IP address for ns.example.com.
*
*
* Type: List of IP addresses.
*
*
* Constraints: The list can contain only one IPv4 and one IPv6 address.
*
*
* Parent: Nameservers
*
*
* @param glueIps
* Glue IP address of a name server entry. Glue IP addresses are
* required only when the name of the name server is a subdomain of
* the domain. For example, if your domain is example.com and the
* name server for the domain is ns.example.com, you need to specify
* the IP address for ns.example.com.
*
* Type: List of IP addresses.
*
*
* Constraints: The list can contain only one IPv4 and one IPv6
* address.
*
*
* Parent: Nameservers
* @return Returns a reference to this object so that method calls can be
* chained together.
*/
public Nameserver withGlueIps(java.util.Collection glueIps) {
setGlueIps(glueIps);
return this;
}
/**
* Returns a string representation of this object; useful for testing and
* debugging.
*
* @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: " + getName() + ",");
if (getGlueIps() != null)
sb.append("GlueIps: " + getGlueIps());
sb.append("}");
return sb.toString();
}
@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (obj instanceof Nameserver == false)
return false;
Nameserver other = (Nameserver) obj;
if (other.getName() == null ^ this.getName() == null)
return false;
if (other.getName() != null
&& other.getName().equals(this.getName()) == false)
return false;
if (other.getGlueIps() == null ^ this.getGlueIps() == null)
return false;
if (other.getGlueIps() != null
&& other.getGlueIps().equals(this.getGlueIps()) == 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
+ ((getGlueIps() == null) ? 0 : getGlueIps().hashCode());
return hashCode;
}
@Override
public Nameserver clone() {
try {
return (Nameserver) super.clone();
} catch (CloneNotSupportedException e) {
throw new IllegalStateException(
"Got a CloneNotSupportedException from Object.clone() "
+ "even though we're Cloneable!", e);
}
}
}