Package org.forgerock.opendj.ldap.schema
Class DitStructureRule.Builder
java.lang.Object
org.forgerock.opendj.ldap.schema.DitStructureRule.Builder
- Enclosing class:
- DitStructureRule
A fluent API for incrementally constructing DIT structure rules.
-
Method Summary
Modifier and TypeMethodDescriptionAdds this DIT structure rule to the schema, throwing aConflictingSchemaElementException
if there is an existing DIT structure rule with the same numeric ID.Adds this DIT structure rule to the schema overwriting any existing DIT structure rule with the same numeric ID.description
(String description) Sets the description.extraProperties
(String extensionName, String... extensionValues) Adds the provided extended property.extraProperties
(String extensionName, List<String> extensionValues) Adds the provided extended property.extraProperties
(Map<String, List<String>> extraProperties) Adds the provided collection of extended properties.Sets the name form associated with the DIT structure rule.Adds the provided user friendly names.names
(Collection<String> names) Adds the provided user friendly names.obsolete
(boolean isObsolete) Specifies whether this schema element is obsolete.Removes all extra properties.Removes all user defined names.Removes all superior rules.removeExtraProperty
(String extensionName, String... extensionValues) Removes the specified extended property.removeName
(String name) Removes the provided user defined name.removeSuperiorRule
(int superiorRuleId) Removes the provided superior rule.ruleId
(int ruleId) Sets the numeric ID which uniquely identifies this structure rule.superiorRules
(int... superiorRuleIds) Adds the provided superior rule identifiers.
-
Method Details
-
addToSchema
Adds this DIT structure rule to the schema, throwing aConflictingSchemaElementException
if there is an existing DIT structure rule with the same numeric ID.- Returns:
- The parent schema builder.
- Throws:
ConflictingSchemaElementException
- If there is an existing structure rule with the same numeric ID.
-
addToSchemaOverwrite
Adds this DIT structure rule to the schema overwriting any existing DIT structure rule with the same numeric ID.- Returns:
- The parent schema builder.
-
description
Sets the description.- Parameters:
description
- The description, which may benull
in which case the empty string will be used.- Returns:
- This builder.
-
extraProperties
Adds the provided collection of extended properties.- Parameters:
extraProperties
- The collection of extended properties.- Returns:
- This builder.
-
extraProperties
Adds the provided extended property.- Parameters:
extensionName
- The name of the extended property.extensionValues
- The optional list of values for the extended property.- Returns:
- This builder.
-
nameForm
Sets the name form associated with the DIT structure rule.- Parameters:
nameFormOID
- The name form numeric OID.- Returns:
- This builder.
-
names
Adds the provided user friendly names.- Parameters:
names
- The user friendly names.- Returns:
- This builder.
-
names
Adds the provided user friendly names.- Parameters:
names
- The user friendly names.- Returns:
- This builder.
-
obsolete
Specifies whether this schema element is obsolete.- Parameters:
isObsolete
-true
if this schema element is obsolete (default isfalse
).- Returns:
- This builder.
-
removeAllExtraProperties
Removes all extra properties.- Returns:
- This builder.
-
removeAllNames
Removes all user defined names.- Returns:
- This builder.
-
removeAllSuperiorRules
Removes all superior rules.- Returns:
- This builder.
-
removeExtraProperty
public DitStructureRule.Builder removeExtraProperty(String extensionName, String... extensionValues) Removes the specified extended property.- Parameters:
extensionName
- The name of the extended property.extensionValues
- The optional list of values for the extended property, which may be empty indicating that the entire property should be removed.- Returns:
- This builder.
-
removeName
Removes the provided user defined name.- Parameters:
name
- The user defined name to be removed.- Returns:
- This builder.
-
removeSuperiorRule
Removes the provided superior rule.- Parameters:
superiorRuleId
- The superior rule ID to be removed.- Returns:
- This builder.
-
ruleId
Sets the numeric ID which uniquely identifies this structure rule.- Parameters:
ruleId
- The numeric ID.- Returns:
- This builder.
-
superiorRules
Adds the provided superior rule identifiers.- Parameters:
superiorRuleIds
- Structure rule identifiers.- Returns:
- This builder.
-
extraProperties
Adds the provided extended property.- Parameters:
extensionName
- The name of the extended property.extensionValues
- The optional list of values for the extended property.- Returns:
- This builder.
-