com.unboundid.ldap.sdk.schema
Class MatchingRuleUseDefinition

java.lang.Object
  extended by com.unboundid.ldap.sdk.schema.SchemaElement
      extended by com.unboundid.ldap.sdk.schema.MatchingRuleUseDefinition
All Implemented Interfaces:
java.io.Serializable

public final class MatchingRuleUseDefinition
extends SchemaElement

This class provides a data structure that describes an LDAP matching rule use schema element.

See Also:
Serialized Form

Constructor Summary
MatchingRuleUseDefinition(java.lang.String s)
          Creates a new matching rule use from the provided string representation.
MatchingRuleUseDefinition(java.lang.String oid, java.lang.String[] names, java.lang.String description, boolean isObsolete, java.lang.String[] applicableTypes, java.util.Map<java.lang.String,java.lang.String[]> extensions)
          Creates a new matching rule use with the provided information.
MatchingRuleUseDefinition(java.lang.String oid, java.lang.String name, java.lang.String description, java.util.Collection<java.lang.String> applicableTypes, java.util.Map<java.lang.String,java.lang.String[]> extensions)
          Creates a new matching rule use with the provided information.
MatchingRuleUseDefinition(java.lang.String oid, java.lang.String name, java.lang.String description, java.lang.String[] applicableTypes, java.util.Map<java.lang.String,java.lang.String[]> extensions)
          Creates a new matching rule use with the provided information.
 
Method Summary
 boolean equals(java.lang.Object o)
          Indicates whether the provided object is equal to this schema element.
 java.lang.String[] getApplicableAttributeTypes()
          Retrieves the names or OIDs of the attribute types to which this matching rule use applies.
 java.lang.String getDescription()
          Retrieves the description for this matching rule use, if available.
 java.util.Map<java.lang.String,java.lang.String[]> getExtensions()
          Retrieves the set of extensions for this matching rule use.
 java.lang.String getNameOrOID()
          Retrieves the primary name that can be used to reference this matching rule use.
 java.lang.String[] getNames()
          Retrieves the set of names for this matching rule use.
 java.lang.String getOID()
          Retrieves the OID for this matching rule use.
 int hashCode()
          Retrieves a hash code for this schema element.
 boolean hasNameOrOID(java.lang.String s)
          Indicates whether the provided string matches the OID or any of the names for this matching rule use.
 boolean isObsolete()
          Indicates whether this matching rule use is declared obsolete.
 java.lang.String toString()
          Retrieves a string representation of this matching rule definition, in the format described in RFC 4512 section 4.1.4.
 
Methods inherited from class com.unboundid.ldap.sdk.schema.SchemaElement
extensionsEqual
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

MatchingRuleUseDefinition

public MatchingRuleUseDefinition(java.lang.String s)
                          throws LDAPException
Creates a new matching rule use from the provided string representation.

Parameters:
s - The string representation of the matching rule use to create, using the syntax described in RFC 4512 section 4.1.4. It must not be null.
Throws:
LDAPException - If the provided string cannot be decoded as a matching rule use definition.

MatchingRuleUseDefinition

public MatchingRuleUseDefinition(java.lang.String oid,
                                 java.lang.String name,
                                 java.lang.String description,
                                 java.lang.String[] applicableTypes,
                                 java.util.Map<java.lang.String,java.lang.String[]> extensions)
Creates a new matching rule use with the provided information.

Parameters:
oid - The OID for this matching rule use. It must not be null.
name - The name for this matching rule use. It may be null or empty if the matching rule use should only be referenced by OID.
description - The description for this matching rule use. It may be null if there is no description.
applicableTypes - The set of attribute types to which this matching rule use applies. It must not be empty or null.
extensions - The set of extensions for this matching rule use. It may be null or empty if there should not be any extensions.

MatchingRuleUseDefinition

public MatchingRuleUseDefinition(java.lang.String oid,
                                 java.lang.String name,
                                 java.lang.String description,
                                 java.util.Collection<java.lang.String> applicableTypes,
                                 java.util.Map<java.lang.String,java.lang.String[]> extensions)
Creates a new matching rule use with the provided information.

Parameters:
oid - The OID for this matching rule use. It must not be null.
name - The name for this matching rule use. It may be null or empty if the matching rule use should only be referenced by OID.
description - The description for this matching rule use. It may be null if there is no description.
applicableTypes - The set of attribute types to which this matching rule use applies. It must not be empty or null.
extensions - The set of extensions for this matching rule use. It may be null or empty if there should not be any extensions.

MatchingRuleUseDefinition

public MatchingRuleUseDefinition(java.lang.String oid,
                                 java.lang.String[] names,
                                 java.lang.String description,
                                 boolean isObsolete,
                                 java.lang.String[] applicableTypes,
                                 java.util.Map<java.lang.String,java.lang.String[]> extensions)
Creates a new matching rule use with the provided information.

Parameters:
oid - The OID for this matching rule use. It must not be null.
names - The set of names for this matching rule use. It may be null or empty if the matching rule use should only be referenced by OID.
description - The description for this matching rule use. It may be null if there is no description.
isObsolete - Indicates whether this matching rule use is declared obsolete.
applicableTypes - The set of attribute types to which this matching rule use applies. It must not be empty or null.
extensions - The set of extensions for this matching rule use. It may be null or empty if there should not be any extensions.
Method Detail

getOID

public java.lang.String getOID()
Retrieves the OID for this matching rule use.

Returns:
The OID for this matching rule use.

getNames

public java.lang.String[] getNames()
Retrieves the set of names for this matching rule use.

Returns:
The set of names for this matching rule use, or an empty array if it does not have any names.

getNameOrOID

public java.lang.String getNameOrOID()
Retrieves the primary name that can be used to reference this matching rule use. If one or more names are defined, then the first name will be used. Otherwise, the OID will be returned.

Returns:
The primary name that can be used to reference this matching rule use.

hasNameOrOID

public boolean hasNameOrOID(java.lang.String s)
Indicates whether the provided string matches the OID or any of the names for this matching rule use.

Parameters:
s - The string for which to make the determination. It must not be null.
Returns:
true if the provided string matches the OID or any of the names for this matching rule use, or false if not.

getDescription

public java.lang.String getDescription()
Retrieves the description for this matching rule use, if available.

Returns:
The description for this matching rule use, or null if there is no description defined.

isObsolete

public boolean isObsolete()
Indicates whether this matching rule use is declared obsolete.

Returns:
true if this matching rule use is declared obsolete, or false if it is not.

getApplicableAttributeTypes

public java.lang.String[] getApplicableAttributeTypes()
Retrieves the names or OIDs of the attribute types to which this matching rule use applies.

Returns:
The names or OIDs of the attribute types to which this matching rule use applies.

getExtensions

public java.util.Map<java.lang.String,java.lang.String[]> getExtensions()
Retrieves the set of extensions for this matching rule use. They will be mapped from the extension name (which should start with "X-") to the set of values for that extension.

Returns:
The set of extensions for this matching rule use.

hashCode

public int hashCode()
Retrieves a hash code for this schema element.

Specified by:
hashCode in class SchemaElement
Returns:
A hash code for this schema element.

equals

public boolean equals(java.lang.Object o)
Indicates whether the provided object is equal to this schema element.

Specified by:
equals in class SchemaElement
Parameters:
o - The object for which to make the determination.
Returns:
true if the provided object may be considered equal to this schema element, or false if not.

toString

public java.lang.String toString()
Retrieves a string representation of this matching rule definition, in the format described in RFC 4512 section 4.1.4.

Specified by:
toString in class SchemaElement
Returns:
A string representation of this matching rule use definition.