Package com.unboundid.ldap.sdk.schema
Class DITStructureRuleDefinition
- java.lang.Object
-
- com.unboundid.ldap.sdk.schema.SchemaElement
-
- com.unboundid.ldap.sdk.schema.DITStructureRuleDefinition
-
- All Implemented Interfaces:
java.io.Serializable
@NotMutable @ThreadSafety(level=COMPLETELY_THREADSAFE) public final class DITStructureRuleDefinition extends SchemaElement
This class provides a data structure that describes an LDAP DIT structure rule schema element.- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description DITStructureRuleDefinition(int ruleID, java.lang.String[] names, java.lang.String description, boolean isObsolete, java.lang.String nameFormID, int[] superiorRuleIDs, java.util.Map<java.lang.String,java.lang.String[]> extensions)
Creates a new DIT structure rule with the provided information.DITStructureRuleDefinition(int ruleID, java.lang.String name, java.lang.String description, java.lang.String nameFormID, java.lang.Integer superiorRuleID, java.util.Map<java.lang.String,java.lang.String[]> extensions)
Creates a new DIT structure rule with the provided information.DITStructureRuleDefinition(java.lang.String s)
Creates a new DIT structure rule from the provided string representation.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
equals(java.lang.Object o)
Indicates whether the provided object is equal to this schema element.java.lang.String
getDescription()
Retrieves the description for this DIT structure rule, if available.java.util.Map<java.lang.String,java.lang.String[]>
getExtensions()
Retrieves the set of extensions for this DIT structure rule.java.lang.String
getNameFormID()
Retrieves the name or OID of the name form with which this DIT structure rule is associated.java.lang.String
getNameOrRuleID()
Retrieves the primary name that can be used to reference this DIT structure rule.java.lang.String[]
getNames()
Retrieves the set of names for this DIT structure rule.int
getRuleID()
Retrieves the rule ID for this DIT structure rule.SchemaElementType
getSchemaElementType()
Retrieves the type of schema element that this object represents.int[]
getSuperiorRuleIDs()
Retrieves the rule IDs of the superior rules for this DIT structure rule.int
hashCode()
Retrieves a hash code for this schema element.boolean
hasNameOrRuleID(java.lang.String s)
Indicates whether the provided string matches the rule ID or any of the names for this DIT structure rule.boolean
isObsolete()
Indicates whether this DIT structure rule is declared obsolete.java.lang.String
toString()
Retrieves a string representation of this DIT structure rule definition, in the format described in RFC 4512 section 4.1.7.1.-
Methods inherited from class com.unboundid.ldap.sdk.schema.SchemaElement
allowEmptyDescription, extensionsEqual, setAllowEmptyDescription
-
-
-
-
Constructor Detail
-
DITStructureRuleDefinition
public DITStructureRuleDefinition(@NotNull java.lang.String s) throws LDAPException
Creates a new DIT structure rule from the provided string representation.- Parameters:
s
- The string representation of the DIT structure rule to create, using the syntax described in RFC 4512 section 4.1.7.1. It must not benull
.- Throws:
LDAPException
- If the provided string cannot be decoded as a DIT structure rule definition.
-
DITStructureRuleDefinition
public DITStructureRuleDefinition(int ruleID, @Nullable java.lang.String name, @Nullable java.lang.String description, @NotNull java.lang.String nameFormID, @Nullable java.lang.Integer superiorRuleID, @Nullable java.util.Map<java.lang.String,java.lang.String[]> extensions)
Creates a new DIT structure rule with the provided information.- Parameters:
ruleID
- The rule ID for this DIT structure rule.name
- The name for this DIT structure rule. It may benull
if the DIT structure rule should only be referenced by rule ID.description
- The description for this DIT structure rule. It may benull
if there is no description.nameFormID
- The name or OID of the name form with which this DIT structure rule is associated. It must not benull
.superiorRuleID
- The superior rule ID for this DIT structure rule. It may benull
if there are no superior rule IDs.extensions
- The set of extensions for this DIT structure rule. It may benull
or empty if there are no extensions.
-
DITStructureRuleDefinition
public DITStructureRuleDefinition(int ruleID, @Nullable java.lang.String[] names, @Nullable java.lang.String description, boolean isObsolete, @NotNull java.lang.String nameFormID, @Nullable int[] superiorRuleIDs, @Nullable java.util.Map<java.lang.String,java.lang.String[]> extensions)
Creates a new DIT structure rule with the provided information.- Parameters:
ruleID
- The rule ID for this DIT structure rule.names
- The set of names for this DIT structure rule. It may benull
or empty if the DIT structure rule should only be referenced by rule ID.description
- The description for this DIT structure rule. It may benull
if there is no description.isObsolete
- Indicates whether this DIT structure rule is declared obsolete.nameFormID
- The name or OID of the name form with which this DIT structure rule is associated. It must not benull
.superiorRuleIDs
- The superior rule IDs for this DIT structure rule. It may benull
or empty if there are no superior rule IDs.extensions
- The set of extensions for this DIT structure rule. It may benull
or empty if there are no extensions.
-
-
Method Detail
-
getRuleID
public int getRuleID()
Retrieves the rule ID for this DIT structure rule.- Returns:
- The rule ID for this DIT structure rule.
-
getNames
@NotNull public java.lang.String[] getNames()
Retrieves the set of names for this DIT structure rule.- Returns:
- The set of names for this DIT structure rule, or an empty array if it does not have any names.
-
getNameOrRuleID
@NotNull public java.lang.String getNameOrRuleID()
Retrieves the primary name that can be used to reference this DIT structure rule. If one or more names are defined, then the first name will be used. Otherwise, the string representation of the rule ID will be returned.- Returns:
- The primary name that can be used to reference this DIT structure rule.
-
hasNameOrRuleID
public boolean hasNameOrRuleID(@NotNull java.lang.String s)
Indicates whether the provided string matches the rule ID or any of the names for this DIT structure rule.- Parameters:
s
- The string for which to make the determination. It must not benull
.- Returns:
true
if the provided string matches the rule ID or any of the names for this DIT structure rule, orfalse
if not.
-
getDescription
@Nullable public java.lang.String getDescription()
Retrieves the description for this DIT structure rule, if available.- Returns:
- The description for this DIT structure rule, or
null
if there is no description defined.
-
isObsolete
public boolean isObsolete()
Indicates whether this DIT structure rule is declared obsolete.- Returns:
true
if this DIT structure rule is declared obsolete, orfalse
if it is not.
-
getNameFormID
@NotNull public java.lang.String getNameFormID()
Retrieves the name or OID of the name form with which this DIT structure rule is associated.- Returns:
- The name or OID of the name form with which this DIT structure rule is associated.
-
getSuperiorRuleIDs
@NotNull public int[] getSuperiorRuleIDs()
Retrieves the rule IDs of the superior rules for this DIT structure rule.- Returns:
- The rule IDs of the superior rules for this DIT structure rule, or an empty array if there are no superior rule IDs.
-
getExtensions
@NotNull public java.util.Map<java.lang.String,java.lang.String[]> getExtensions()
Retrieves the set of extensions for this DIT structure rule. 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 DIT structure rule.
-
getSchemaElementType
@NotNull public SchemaElementType getSchemaElementType()
Retrieves the type of schema element that this object represents.- Specified by:
getSchemaElementType
in classSchemaElement
- Returns:
- The type of schema element that this object represents.
-
hashCode
public int hashCode()
Retrieves a hash code for this schema element.- Specified by:
hashCode
in classSchemaElement
- Returns:
- A hash code for this schema element.
-
equals
public boolean equals(@Nullable java.lang.Object o)
Indicates whether the provided object is equal to this schema element.- Specified by:
equals
in classSchemaElement
- Parameters:
o
- The object for which to make the determination.- Returns:
true
if the provided object may be considered equal to this schema element, orfalse
if not.
-
toString
@NotNull public java.lang.String toString()
Retrieves a string representation of this DIT structure rule definition, in the format described in RFC 4512 section 4.1.7.1.- Specified by:
toString
in classSchemaElement
- Returns:
- A string representation of this DIT structure rule definition.
-
-