Package org.ldaptive.dn
Class DefaultRDnNormalizer
java.lang.Object
org.ldaptive.dn.DefaultRDnNormalizer
- All Implemented Interfaces:
RDnNormalizer
Normalizes a RDN by performing the following operations:
- lowercase attribute names
- lowercase attribute values
- compress duplicate spaces in attribute values
- escape attribute value characters
- sort multi value RDNs by name
-
Field Summary
FieldsModifier and TypeFieldDescriptionAttribute name function.private final AttributeValueEscaperAttribute value escaper.Attribute value function.static final Comparator<NameValue>Comparator that compares name values by name.Function that removes duplicate spaces from the value.Function that lowercases the value.Function that lowercases and removes duplicate spaces from the value.private final Comparator<NameValue>Name value comparator for sorting. -
Constructor Summary
ConstructorsConstructorDescriptionCreates a new default RDN normalizer.Creates a new default RDN normalizer.DefaultRDnNormalizer(AttributeValueEscaper escaper, Function<String, String> nameNormalizer, Function<String, String> valueNormalizer) Creates a new default RDN normalizer.DefaultRDnNormalizer(AttributeValueEscaper escaper, Function<String, String> nameNormalizer, Function<String, String> valueNormalizer, Comparator<NameValue> comparator) Creates a new default RDN normalizer. -
Method Summary
Modifier and TypeMethodDescriptionReturns the attribute name function.Returns the value escaper.Returns the attribute value function.Normalize the name value pairs in the supplied RDN.toString()
-
Field Details
-
LOWERCASE
Function that lowercases the value. -
COMPRESS
Function that removes duplicate spaces from the value. -
LOWERCASE_COMPRESS
Function that lowercases and removes duplicate spaces from the value. -
COMPARE_BY_NAME
Comparator that compares name values by name. -
attributeNameFunction
Attribute name function. -
attributeValueFunction
Attribute value function. -
attributeValueEscaper
Attribute value escaper. -
nameValueComparator
Name value comparator for sorting.
-
-
Constructor Details
-
DefaultRDnNormalizer
public DefaultRDnNormalizer()Creates a new default RDN normalizer. -
DefaultRDnNormalizer
Creates a new default RDN normalizer.- Parameters:
escaper- to escape attribute values
-
DefaultRDnNormalizer
public DefaultRDnNormalizer(AttributeValueEscaper escaper, Function<String, String> nameNormalizer, Function<String, String> valueNormalizer) Creates a new default RDN normalizer.- Parameters:
escaper- to escape attribute valuesnameNormalizer- to normalize attribute namesvalueNormalizer- to normalize attribute values
-
DefaultRDnNormalizer
public DefaultRDnNormalizer(AttributeValueEscaper escaper, Function<String, String> nameNormalizer, Function<String, String> valueNormalizer, Comparator<NameValue> comparator) Creates a new default RDN normalizer.- Parameters:
escaper- to escape attribute valuesnameNormalizer- to normalize attribute namesvalueNormalizer- to normalize attribute valuescomparator- for sorting RDN name values
-
-
Method Details
-
getValueEscaper
Returns the value escaper.- Returns:
- value escaper
-
getNameFunction
Returns the attribute name function.- Returns:
- function for attribute names
-
getValueFunction
Returns the attribute value function.- Returns:
- function for attribute values
-
normalize
Description copied from interface:RDnNormalizerNormalize the name value pairs in the supplied RDN.- Specified by:
normalizein interfaceRDnNormalizer- Parameters:
rdn- to normalize- Returns:
- new normalized RDN
-
toString
-