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
Fields -
Constructor Summary
ConstructorsConstructorDescriptionDeprecated.Only required for implementation, do not use directly. -
Method Summary
Modifier and TypeMethodDescriptionintcompareTo(DomainLabel other) booleangetDto()longinthashCode()intern()Interns this label much in the same fashion asString.intern().voidGets the lower-case form of the label.toString()static ValidationResultValidates a domain name label.static ValidationResultstatic DomainLabelvoid
-
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:
compareToin 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:
internin interfaceInternable<DomainLabel>- See Also:
-
getDto
- Specified by:
getDtoin interfaceDtoFactory<DomainLabel>
-
getSerialVersionUID
public long getSerialVersionUID()- Specified by:
getSerialVersionUIDin interfaceFastExternalizable
-
writeExternal
- Specified by:
writeExternalin interfaceExternalizable- Throws:
IOException
-
readExternal
- Specified by:
readExternalin interfaceExternalizable- Throws:
IOExceptionClassNotFoundException
-
