Package org.minidns.dnslabel
Class DnsLabel
java.lang.Object
org.minidns.util.SafeCharSequence
org.minidns.dnslabel.DnsLabel
- All Implemented Interfaces:
- CharSequence,- Comparable<DnsLabel>
- Direct Known Subclasses:
- LdhLabel,- NonLdhLabel
A DNS label is an individual component of a DNS name. Labels are usually shown separated by dots.
 
 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.
- See Also:
- 
Nested Class SummaryNested Classes
- 
Field SummaryFields
- 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptionfinal DnsLabelfinal intstatic booleanstatic booleanfinal booleanstatic DnsLabelstatic DnsLabel[]final Stringprotected Stringfinal Stringfinal StringGet the raw label.final inthashCode()static booleanisIdnAcePrefixed(String string) static StringtoSafeRepesentation(String dnsLabel) final StringtoString()final voidwriteToBoas(ByteArrayOutputStream byteArrayOutputStream) Methods inherited from class org.minidns.util.SafeCharSequencecharAt, length, subSequence, toSafeStringMethods inherited from class java.lang.Objectclone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface java.lang.CharSequencechars, codePoints
- 
Field Details- 
MAX_LABEL_LENGTH_IN_OCTETSThe maximum length of a DNS label in octets.- See Also:
 
- 
WILDCARD_LABEL
- 
VALIDATEWhether or not the DNS label is validated on construction.
- 
label
 
- 
- 
Constructor Details- 
DnsLabel
 
- 
- 
Method Details- 
getInternationalizedRepresentation
- 
getInternationalizedRepresentationInternal
- 
getLabelType
- 
toString- Specified by:
- toStringin interface- CharSequence
- Overrides:
- toStringin class- Object
 
- 
getRawLabelGet the raw label. Note that this may return a String containing null bytes. Those Strings are notoriously difficult to handle from a security perspective. Therefore it is recommended to usetoString()instead, which will return a sanitized String.- Returns:
- the raw label.
- Since:
- 1.1.0
 
- 
equals
- 
hashCode
- 
asLowercaseVariant
- 
writeToBoas
- 
compareTo- Specified by:
- compareToin interface- Comparable<DnsLabel>
 
- 
from
- 
from
- 
isIdnAcePrefixed
- 
toSafeRepesentation
- 
consistsOnlyOfLettersDigitsAndHypen
- 
consistsOnlyOfLettersDigitsHypenAndUnderscore
 
-