java.lang.Object
com.aoapps.net.DomainLabel
- All Implemented Interfaces:
DtoFactory<DomainLabel>
,FastExternalizable
,Internable<DomainLabel>
,Externalizable
,Serializable
,Comparable<DomainLabel>
public final class DomainLabel
extends Object
implements Comparable<DomainLabel>, FastExternalizable, DtoFactory<DomainLabel>, Internable<DomainLabel>
Represents a DNS domain label (a single part of a domain name between dots). Domain labels must:
- Be non-null
- Be non-empty
- Conforms to definition in https://wikipedia.org/wiki/DNS_label#Parts_of_a_domain_name
- Conforms to RFC 2181
- And allow all numeric as described in RFC 1123
- Author:
- AO Industries, Inc.
- See Also:
-
Field Summary
-
Constructor Summary
ConstructorDescriptionDeprecated.Only required for implementation, do not use directly. -
Method Summary
Modifier and TypeMethodDescriptionint
compareTo
(DomainLabel other) boolean
getDto()
long
int
hashCode()
intern()
Interns this label much in the same fashion asString.intern()
.void
Gets the lower-case form of the label.toString()
static ValidationResult
Validates a domain name label.static ValidationResult
static DomainLabel
void
-
Field Details
-
MAX_LENGTH
public static final int MAX_LENGTH- See Also:
-
-
Constructor Details
-
DomainLabel
Deprecated.Only required for implementation, do not use directly.- See Also:
-
-
Method Details
-
validate
Validates a domain name label. -
validate
-
valueOf
- Parameters:
label
- whennull
, returnsnull
- Throws:
ValidationException
-
equals
-
hashCode
public int hashCode() -
compareTo
- Specified by:
compareTo
in interfaceComparable<DomainLabel>
-
toString
-
toLowerCase
Gets the lower-case form of the label. If two different domain labels are interned and their toLowerCase is the same String instance, then they are equal in case-insensitive manner. -
intern
Interns this label much in the same fashion asString.intern()
.- Specified by:
intern
in interfaceInternable<DomainLabel>
- See Also:
-
getDto
- Specified by:
getDto
in interfaceDtoFactory<DomainLabel>
-
getSerialVersionUID
public long getSerialVersionUID()- Specified by:
getSerialVersionUID
in interfaceFastExternalizable
-
writeExternal
- Specified by:
writeExternal
in interfaceExternalizable
- Throws:
IOException
-
readExternal
- Specified by:
readExternal
in interfaceExternalizable
- Throws:
IOException
ClassNotFoundException
-