Class DnComparator
- 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<Object>
-
- org.apache.directory.api.ldap.model.schema.comparators.DnComparator
-
- All Implemented Interfaces:
Serializable,Comparator<Object>,SchemaObject
public class DnComparator extends LdapComparator<Object>
Compare two DNs- Author:
- Apache Directory Project
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description private SchemaManagerschemaManagerA reference to the schema managerprivate static longserialVersionUIDThe serial version UID-
Fields inherited from class org.apache.directory.api.ldap.model.schema.LdapComparator
normalizer
-
Fields inherited from class org.apache.directory.api.ldap.model.schema.AbstractSchemaObject
description, extensions, h, isEnabled, isObsolete, locked, names, objectType, oid, schemaName, specification
-
-
Constructor Summary
Constructors Constructor Description DnComparator(String oid)Creates a new instance of DnComparator.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description intcompare(Object obj0, Object obj1)intcompare(String dn1, String dn2)Compare two String DNsprivate DngetDn(Object obj)voidsetSchemaManager(SchemaManager schemaManager)Store the SchemaManager in this instance.-
Methods inherited from class org.apache.directory.api.ldap.model.schema.LdapComparator
equals, getNormalizer, hashCode, 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, compareOid, computeHashCode, copy, getDescription, getExtension, getExtensions, getName, getNames, getObjectType, getOid, getSchemaName, getSpecification, hasExtension, isDisabled, isEnabled, isObsolete, lock, setDescription, setEnabled, setExtensions, setNames, setNames, setObsolete, setOid, setSchemaName, setSpecification, unlock
-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface java.util.Comparator
reversed, thenComparing, thenComparing, thenComparing, thenComparingDouble, thenComparingInt, thenComparingLong
-
-
-
-
Field Detail
-
serialVersionUID
private static final long serialVersionUID
The serial version UID- See Also:
- Constant Field Values
-
schemaManager
private transient SchemaManager schemaManager
A reference to the schema manager
-
-
Constructor Detail
-
DnComparator
public DnComparator(String oid)
Creates a new instance of DnComparator.- Parameters:
oid- The Comparator's OID
-
-
Method Detail
-
compare
public int compare(String dn1, String dn2)
Compare two String DNs- Parameters:
dn1- The first DNdn2- The second DN- Returns:
- -1 i the first DN is inferior to the second DN, 1 if the second DN is superior, 0 of they are equal
-
getDn
private Dn getDn(Object obj) throws LdapInvalidDnException
- Throws:
LdapInvalidDnException
-
setSchemaManager
public void setSchemaManager(SchemaManager schemaManager)
Store the SchemaManager in this instance. It may be necessary for some comparator which needs to have access to the oidNormalizer Map.- Overrides:
setSchemaManagerin classLdapComparator<Object>- Parameters:
schemaManager- the schemaManager to store
-
-