public abstract class LdhLabel extends DnsLabel
Note that it is a common misconception that LDH labels can not start with a digit. The origin of this misconception is likely that RFC 1034 § 3.5 specified
They [i.e, DNS labels] must start with a letter, end with a letter or digit, and have as interior characters only letters, digits, and hyphen.. However, this was relaxed in RFC 1123 § 2.1
One aspect of host name syntax is hereby changed: the restriction on the first character is relaxed to allow either a letter or a digit.and later summarized in RFC 3696 § 2:
If the hyphen is used, it is not permitted to appear at either the beginning or end of a label.Furthermore RFC 5890 § 2.3.1 only mentions the requirement that hyphen must not be the first or last character of a LDH label.
DnsLabel.LabelToLongExceptionlabel, MAX_LABEL_LENGTH_IN_OCTETS, WILDCARD_LABEL| Modifier | Constructor and Description |
|---|---|
protected | LdhLabel(String label)Creates a new LdhLabel |
| Modifier and Type | Method and Description |
|---|---|
protected static LdhLabel | fromInternal(String label)Creates an LdhLabel from internal representation |
static boolean | isLdhLabel(String label)Determine if the given label is an LDH (letters, digits, hyphen) label. |
asLowercaseVariant, compareTo, consistsOnlyOfLettersDigitsAndHypen, consistsOnlyOfLettersDigitsHypenAndUnderscore, equals, from, from, getInternationalizedRepresentation, getInternationalizedRepresentationInternal, getLabelType, getRawLabel, hashCode, isIdnAcePrefixed, toSafeRepesentation, toString, writeToBoascharAt, length, subSequence, toSafeStringclone, finalize, getClass, notify, notifyAll, wait, wait, waitchars, codePointsprotected LdhLabel(String label)
label - the label stringprotected static LdhLabel fromInternal(String label)
label - the internal label stringpublic static boolean isLdhLabel(String label)
label - the label to check