Package org.forgerock.opendj.ldap.schema
Class MatchingRuleUse
- java.lang.Object
-
- org.forgerock.opendj.ldap.schema.MatchingRuleUse
-
- All Implemented Interfaces:
SchemaElement
public final class MatchingRuleUse extends Object
This class defines a data structure for storing and interacting with a matching rule use definition, which may be used to restrict the set of attribute types that may be used for a given matching rule.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classMatchingRuleUse.BuilderA fluent API for incrementally constructing matching rule uses.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanequals(Object o)Returnstrueif the provided object is a matching rule use having the same numeric OID as this matching rule use.Set<AttributeType>getAttributes()Returns an unmodifiable set containing the attributes associated with this matching rule use.StringgetDescription()Returns the description of this schema element, or the empty string if it does not have a description.Map<String,List<String>>getExtraProperties()Returns an unmodifiable map containing all of the extra properties associated with this schema element.MatchingRulegetMatchingRule()Returns the matching rule for this matching rule use.StringgetMatchingRuleOid()Returns the matching rule OID for this schema definition.StringgetNameOrOid()Returns the name or matching rule OID for this schema definition.List<String>getNames()Returns an unmodifiable list containing the user-defined names that may be used to reference this schema definition.booleanhasAttribute(AttributeType attributeType)Indicates whether the provided attribute type is referenced by this matching rule use.inthashCode()Returns the hash code for this matching rule use.booleanhasName(String name)Indicates whether this schema definition has the specified name.booleanhasNameOrOid(String value)Indicates whether this schema definition has the specified name or matching rule OID.booleanisObsolete()Indicates whether this schema definition is declared "obsolete".StringtoString()Returns the string representation of this schema element as defined in RFC 2252.
-
-
-
Method Detail
-
equals
public boolean equals(Object o)
Returnstrueif the provided object is a matching rule use having the same numeric OID as this matching rule use.- Parameters:
o- The object to be compared.- Returns:
trueif the provided object is a matching rule use having the same numeric OID as this matching rule use.
-
getAttributes
public Set<AttributeType> getAttributes()
Returns an unmodifiable set containing the attributes associated with this matching rule use.- Returns:
- An unmodifiable set containing the attributes associated with this matching rule use.
-
getMatchingRule
public MatchingRule getMatchingRule()
Returns the matching rule for this matching rule use.- Returns:
- The matching rule for this matching rule use.
-
getMatchingRuleOid
public String getMatchingRuleOid()
Returns the matching rule OID for this schema definition.- Returns:
- The OID for this schema definition.
-
getNameOrOid
public String getNameOrOid()
Returns the name or matching rule OID for this schema definition. If it has one or more names, then the primary name will be returned. If it does not have any names, then the OID will be returned.- Returns:
- The name or OID for this schema definition.
-
getNames
public List<String> getNames()
Returns an unmodifiable list containing the user-defined names that may be used to reference this schema definition.- Returns:
- Returns an unmodifiable list containing the user-defined names that may be used to reference this schema definition.
-
hasAttribute
public boolean hasAttribute(AttributeType attributeType)
Indicates whether the provided attribute type is referenced by this matching rule use.- Parameters:
attributeType- The attribute type for which to make the determination.- Returns:
trueif the provided attribute type is referenced by this matching rule use, orfalseif it is not.
-
hashCode
public int hashCode()
Returns the hash code for this matching rule use. It will be calculated as the hash code of the numeric OID.- Returns:
- The hash code for this matching rule use.
-
hasName
public boolean hasName(String name)
Indicates whether this schema definition has the specified name.- Parameters:
name- The name for which to make the determination.- Returns:
trueif the specified name is assigned to this schema definition, orfalseif not.
-
hasNameOrOid
public boolean hasNameOrOid(String value)
Indicates whether this schema definition has the specified name or matching rule OID.- Parameters:
value- The value for which to make the determination.- Returns:
trueif the provided value matches the OID or one of the names assigned to this schema definition, orfalseif not.
-
isObsolete
public boolean isObsolete()
Indicates whether this schema definition is declared "obsolete".- Returns:
trueif this schema definition is declared "obsolete", orfalseif not.
-
getDescription
public final String getDescription()
Description copied from interface:SchemaElementReturns the description of this schema element, or the empty string if it does not have a description.- Specified by:
getDescriptionin interfaceSchemaElement- Returns:
- The description of this schema element, or the empty string if it does not have a description.
-
getExtraProperties
public final Map<String,List<String>> getExtraProperties()
Description copied from interface:SchemaElementReturns an unmodifiable map containing all of the extra properties associated with this schema element.- Specified by:
getExtraPropertiesin interfaceSchemaElement- Returns:
- An unmodifiable map containing all of the extra properties associated with this schema element.
-
-