public abstract class DnsLabel extends Object implements CharSequence, Comparable<DnsLabel>
This class implements Comparable which compares DNS labels according to the Canonical DNS Name Order as
specified in RFC 4034 § 6.1.
Note that as per RFC 2181 § 11 DNS labels may contain any byte.
| Modifier and Type | Class and Description |
|---|---|
static class |
DnsLabel.LabelToLongException
Exception thrown when a DNS label exceeds the maximum allowed length.
DNS labels are limited to 63 characters according to RFC 1035. |
| Modifier and Type | Field and Description |
|---|---|
String |
label |
static int |
MAX_LABEL_LENGTH_IN_OCTETS
The maximum length of a DNS label in octets.
|
static boolean |
VALIDATE
Whether or not the DNS label is validated on construction.
|
static DnsLabel |
WILDCARD_LABEL |
| Modifier | Constructor and Description |
|---|---|
protected |
DnsLabel(String label) |
| Modifier and Type | Method and Description |
|---|---|
DnsLabel |
asLowercaseVariant() |
char |
charAt(int index) |
int |
compareTo(DnsLabel other) |
boolean |
equals(Object other) |
static DnsLabel |
from(String label) |
static DnsLabel[] |
from(String[] labels) |
String |
getInternationalizedRepresentation() |
protected String |
getInternationalizedRepresentationInternal()
Gets the internal internationalized representation.
|
String |
getLabelType() |
int |
hashCode() |
static boolean |
isIdnAcePrefixed(String string) |
int |
length() |
CharSequence |
subSequence(int start,
int end) |
String |
toString() |
void |
writeToBoas(ByteArrayOutputStream byteArrayOutputStream) |
clone, finalize, getClass, notify, notifyAll, wait, wait, waitchars, codePointspublic final String label
public static final int MAX_LABEL_LENGTH_IN_OCTETS
public static final boolean VALIDATE
public static final DnsLabel WILDCARD_LABEL
protected DnsLabel(String label)
public final DnsLabel asLowercaseVariant()
public final char charAt(int index)
charAt in interface CharSequencepublic final int compareTo(DnsLabel other)
compareTo in interface Comparable<DnsLabel>public final String getInternationalizedRepresentation()
protected String getInternationalizedRepresentationInternal()
public final String getLabelType()
public static boolean isIdnAcePrefixed(String string)
public final int length()
length in interface CharSequencepublic final CharSequence subSequence(int start, int end)
subSequence in interface CharSequencepublic final String toString()
toString in interface CharSequencetoString in class Objectpublic final void writeToBoas(ByteArrayOutputStream byteArrayOutputStream)