java.lang.Object
org.minidns.util.SafeCharSequence
org.minidns.dnslabel.DnsLabel
org.minidns.dnslabel.NonLdhLabel
org.minidns.dnslabel.LeadingOrTrailingHyphenLabel
- All Implemented Interfaces:
CharSequence, Comparable<DnsLabel>
A DNS label with a leading or trailing hyphen ('-').
Nested Class Summary
Nested classes/interfaces inherited from class DnsLabel
DnsLabel.LabelToLongExceptionModifier and TypeClassDescriptionstatic classThrown when a DNS label exceeds the maximum length.Field Summary
Fields inherited from class DnsLabel
label, MAX_LABEL_LENGTH_IN_OCTETS, WILDCARD_LABELConstructor Summary
ConstructorsMethod Summary
All MethodsModifier and TypeMethodDescription(package private) static booleanTest whether a label begins or ends with a hyphen.Methods inherited from class NonLdhLabel
fromInternalModifier and TypeMethodDescriptionprotected static DnsLabelfromInternal(String label) Chooses the concrete label class matching a non-LDH label's flavour.Methods inherited from class DnsLabel
asLowercaseVariant, compareTo, consistsOnlyOfLettersDigitsAndHypen, consistsOnlyOfLettersDigitsHypenAndUnderscore, equals, from, from, getInternationalizedRepresentation, getInternationalizedRepresentationInternal, getLabelType, getRawLabel, hashCode, isIdnAcePrefixed, toSafeRepesentation, toString, writeToBoasModifier and TypeMethodDescriptionfinal DnsLabelGet the lowercase variant of this label.final intOrder labels case-insensitively, ignoring letter case.static booleanCheck if a string consists of only letters, digits, and hyphens.static booleanCheck if a string consists of only letters, digits, hyphens, and underscores.final booleanCompare the label text against another label.static DnsLabelCreate a DnsLabel from a string.static DnsLabel[]Create DnsLabel array from string array.final StringGet the internationalized representation of this label.protected StringGets the internal internationalized representation.final StringGet the type of this label.final StringGet the raw label.final inthashCode()Hash the label text.static booleanisIdnAcePrefixed(String string) Check if a string has the IDN ACE prefix.static StringtoSafeRepesentation(String dnsLabel) Convert a DNS label string to a safe representation.final StringtoString()Render the label with every character outside the LDH set escaped.final voidwriteToBoas(ByteArrayOutputStream byteArrayOutputStream) Write this label to a ByteArrayOutputStream prefixed by its length.Methods inherited from class SafeCharSequence
charAt, length, subSequence, toSafeStringModifier and TypeMethodDescriptionfinal charcharAt(int index) Returns one character of the safe string form.final intlength()Counts the characters of the safe string form.final CharSequencesubSequence(int start, int end) Returns a safe substring of the safe string form.Return a safe string representation.Methods inherited from interface CharSequence
chars, codePoints, getChars, isEmpty
Constructor Details
LeadingOrTrailingHyphenLabel
LeadingOrTrailingHyphenLabel(String label) Create label- Parameters:
label- the full label text, which is expected to have a leading or trailing hyphen
Method Details
isLeadingOrTrailingHypenLabelInternal
Test whether a label begins or ends with a hyphen.- Parameters:
label- the label text to inspect; an empty label is not a hyphen label- Returns:
- true if label starts or ends with hyphen