Class MatchingRule
- java.lang.Object
-
- org.apache.directory.api.ldap.model.schema.AbstractSchemaObject
-
- org.apache.directory.api.ldap.model.schema.MatchingRule
-
- All Implemented Interfaces:
Serializable
,SchemaObject
public class MatchingRule extends AbstractSchemaObject
A matchingRule definition. MatchingRules associate a comparator and a normalizer, forming the basic tools necessary to assert actions against attribute values. MatchingRules are associated with a specific Syntax for the purpose of resolving a normalized form and for comparisons.According to ldapbis [MODELS]:
4.1.3. Matching Rules Matching rules are used by servers to compare attribute values against assertion values when performing Search and Compare operations. They are also used to identify the value to be added or deleted when modifying entries, and are used when comparing a purported distinguished name with the name of an entry. A matching rule specifies the syntax of the assertion value. Each matching rule is identified by an object identifier (OID) and, optionally, one or more short names (descriptors). Matching rule definitions are written according to the ABNF: MatchingRuleDescription = LPAREN WSP numericoid ; object identifier [ SP "NAME" SP qdescrs ] ; short names (descriptors) [ SP "DESC" SP qdstring ] ; description [ SP "OBSOLETE" ] ; not active SP "SYNTAX" SP numericoid ; assertion syntax extensions WSP RPAREN ; extensions where: [numericoid] is object identifier assigned to this matching rule; NAME [qdescrs] are short names (descriptors) identifying this matching rule; DESC [qdstring] is a short descriptive string; OBSOLETE indicates this matching rule is not active; SYNTAX identifies the assertion syntax by object identifier; and [extensions] describe extensions.
- Author:
- Apache Directory Project
- See Also:
- RFC 2252 Section 4.5, ldapbis [MODELS], Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description static long
serialVersionUID
The mandatory serialVersionUID
-
Constructor Summary
Constructors Constructor Description MatchingRule(String oid)
Creates a new instance of MatchingRule.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
clear()
Clear the current SchemaObject : remove all the references to other objects, and all the Maps.MatchingRule
copy()
Copy an MatchingRuleboolean
equals(Object o)
LdapComparator<? super Object>
getLdapComparator()
Gets the LdapComparator enabling the use of this MatchingRule for ORDERING and sorted indexing.Normalizer
getNormalizer()
Gets the Normalizer enabling the use of this MatchingRule for EQUALITY matching and indexing.LdapSyntax
getSyntax()
Gets the LdapSyntax used by this MatchingRule.String
getSyntaxOid()
Gets the LdapSyntax OID used by this MatchingRule.int
hashCode()
void
setLdapComparator(LdapComparator<?> ldapComparator)
Sets the LdapComparatorvoid
setNormalizer(Normalizer normalizer)
Sets the Normalizervoid
setSyntax(LdapSyntax ldapSyntax)
Sets the Syntaxvoid
setSyntaxOid(String oid)
Sets the Syntax's OIDString
toString()
-
Methods inherited from class org.apache.directory.api.ldap.model.schema.AbstractSchemaObject
addExtension, addExtension, addName, 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
-
-
-
-
Field Detail
-
serialVersionUID
public static final long serialVersionUID
The mandatory serialVersionUID- See Also:
- Constant Field Values
-
-
Constructor Detail
-
MatchingRule
public MatchingRule(String oid)
Creates a new instance of MatchingRule.- Parameters:
oid
- The MatchingRule OID
-
-
Method Detail
-
getSyntax
public LdapSyntax getSyntax()
Gets the LdapSyntax used by this MatchingRule.- Returns:
- the LdapSyntax of this MatchingRule
-
setSyntax
public void setSyntax(LdapSyntax ldapSyntax)
Sets the Syntax- Parameters:
ldapSyntax
- The Syntax
-
getSyntaxOid
public String getSyntaxOid()
Gets the LdapSyntax OID used by this MatchingRule.- Returns:
- the LdapSyntax of this MatchingRule
-
setSyntaxOid
public void setSyntaxOid(String oid)
Sets the Syntax's OID- Parameters:
oid
- The Syntax's OID
-
getLdapComparator
public LdapComparator<? super Object> getLdapComparator()
Gets the LdapComparator enabling the use of this MatchingRule for ORDERING and sorted indexing.- Returns:
- the ordering LdapComparator
-
setLdapComparator
public void setLdapComparator(LdapComparator<?> ldapComparator)
Sets the LdapComparator- Parameters:
ldapComparator
- The LdapComparator
-
getNormalizer
public Normalizer getNormalizer()
Gets the Normalizer enabling the use of this MatchingRule for EQUALITY matching and indexing.- Returns:
- the associated normalizer
-
setNormalizer
public void setNormalizer(Normalizer normalizer)
Sets the Normalizer- Parameters:
normalizer
- The Normalizer
-
toString
public String toString()
- Overrides:
toString
in classObject
- See Also:
Object.toString()
-
copy
public MatchingRule copy()
Copy an MatchingRule- Returns:
- The copied SchemaObject
-
hashCode
public int hashCode()
Description copied from class:AbstractSchemaObject
- Specified by:
hashCode
in interfaceSchemaObject
- Overrides:
hashCode
in classAbstractSchemaObject
- See Also:
Object.equals(Object)
-
equals
public boolean equals(Object o)
Description copied from class:AbstractSchemaObject
- Specified by:
equals
in interfaceSchemaObject
- Overrides:
equals
in classAbstractSchemaObject
- See Also:
Object.equals(Object)
-
clear
public void clear()
Clear the current SchemaObject : remove all the references to other objects, and all the Maps.- Specified by:
clear
in interfaceSchemaObject
- Overrides:
clear
in classAbstractSchemaObject
-
-