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 |
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() |
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, wait
chars, codePoints
public static final int MAX_LABEL_LENGTH_IN_OCTETS
public static final DnsLabel WILDCARD_LABEL
public static boolean VALIDATE
public final String label
protected DnsLabel(String label)
public final String getInternationalizedRepresentation()
protected String getInternationalizedRepresentationInternal()
public final String getLabelType()
public final int length()
length
in interface CharSequence
public final char charAt(int index)
charAt
in interface CharSequence
public final CharSequence subSequence(int start, int end)
subSequence
in interface CharSequence
public final String toString()
toString
in interface CharSequence
toString
in class Object
public final DnsLabel asLowercaseVariant()
public final void writeToBoas(ByteArrayOutputStream byteArrayOutputStream)
public final int compareTo(DnsLabel other)
compareTo
in interface Comparable<DnsLabel>
public static boolean isIdnAcePrefixed(String string)