Class NormalizingComparator
- java.lang.Object
-
- org.apache.directory.api.ldap.model.schema.AbstractSchemaObject
-
- org.apache.directory.api.ldap.model.schema.LoadableSchemaObject
-
- org.apache.directory.api.ldap.model.schema.LdapComparator<String>
-
- org.apache.directory.api.ldap.model.schema.comparators.NormalizingComparator
-
- All Implemented Interfaces:
Serializable
,Comparator<String>
,SchemaObject
public class NormalizingComparator extends LdapComparator<String>
A comparator which normalizes a value first before using a subordinate comparator to compare them.- Author:
- Apache Directory Project
- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description NormalizingComparator(String oid)
The NormalizingComparator constructor.NormalizingComparator(String oid, Normalizer normalizer, LdapComparator<String> comparator)
A comparator which normalizes a value first before comparing them.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description int
compare(String o1, String o2)
void
setOid(String oid)
A special method used when renaming an SchemaObject: we may have to change it's OIDvoid
setOnServer()
tells that the normalizingComparator should not normalize values which are already normalized on the server-
Methods inherited from class org.apache.directory.api.ldap.model.schema.LdapComparator
equals, getNormalizer, hashCode, setSchemaManager, toString
-
Methods inherited from class org.apache.directory.api.ldap.model.schema.LoadableSchemaObject
copy, getBytecode, getFqcn, isValid, setBytecode, setFqcn
-
Methods inherited from class org.apache.directory.api.ldap.model.schema.AbstractSchemaObject
addExtension, addExtension, addName, clear, copy, getDescription, getExtension, getExtensions, getName, getNames, getObjectType, getOid, getSchemaName, getSpecification, hasExtension, isDisabled, isEnabled, isObsolete, lock, setDescription, setEnabled, setExtensions, setNames, setNames, setObsolete, setSchemaName, setSpecification, unlock
-
Methods inherited from interface java.util.Comparator
reversed, thenComparing, thenComparing, thenComparing, thenComparingDouble, thenComparingInt, thenComparingLong
-
-
-
-
Constructor Detail
-
NormalizingComparator
public NormalizingComparator(String oid)
The NormalizingComparator constructor. Its OID is the matching rule OID.- Parameters:
oid
- The Comparator's OID
-
NormalizingComparator
public NormalizingComparator(String oid, Normalizer normalizer, LdapComparator<String> comparator)
A comparator which normalizes a value first before comparing them.- Parameters:
oid
- The Comparator's OIDnormalizer
- the Normalizer to normalize values with before comparingcomparator
- the underlying comparator to use for comparisons
-
-
Method Detail
-
setOid
public void setOid(String oid)
A special method used when renaming an SchemaObject: we may have to change it's OID This implementation makes sure we update the oid property of the contained normalizer and comparator.- Specified by:
setOid
in interfaceSchemaObject
- Overrides:
setOid
in classAbstractSchemaObject
- Parameters:
oid
- The new OID
-
setOnServer
public void setOnServer()
tells that the normalizingComparator should not normalize values which are already normalized on the server
-
-