Package org.forgerock.opendj.ldap.schema
Class DitStructureRule.Builder
- java.lang.Object
-
- org.forgerock.opendj.ldap.schema.DitStructureRule.Builder
-
- Enclosing class:
- DitStructureRule
public static final class DitStructureRule.Builder extends Object
A fluent API for incrementally constructing DIT structure rules.
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description SchemaBuilderaddToSchema()Adds this DIT structure rule to the schema, throwing aConflictingSchemaElementExceptionif there is an existing DIT structure rule with the same numeric ID.SchemaBuilderaddToSchemaOverwrite()Adds this DIT structure rule to the schema overwriting any existing DIT structure rule with the same numeric ID.DitStructureRule.Builderdescription(String description)Sets the description.DitStructureRule.BuilderextraProperties(String extensionName, String... extensionValues)Adds the provided extended property.TextraProperties(String extensionName, List<String> extensionValues)Adds the provided extended property.DitStructureRule.BuilderextraProperties(Map<String,List<String>> extraProperties)Adds the provided collection of extended properties.DitStructureRule.BuildernameForm(String nameFormOID)Sets the name form associated with the DIT structure rule.DitStructureRule.Buildernames(String... names)Adds the provided user friendly names.DitStructureRule.Buildernames(Collection<String> names)Adds the provided user friendly names.DitStructureRule.Builderobsolete(boolean isObsolete)Specifies whether this schema element is obsolete.DitStructureRule.BuilderremoveAllExtraProperties()Removes all extra properties.DitStructureRule.BuilderremoveAllNames()Removes all user defined names.DitStructureRule.BuilderremoveAllSuperiorRules()Removes all superior rules.DitStructureRule.BuilderremoveExtraProperty(String extensionName, String... extensionValues)Removes the specified extended property.DitStructureRule.BuilderremoveName(String name)Removes the provided user defined name.DitStructureRule.BuilderremoveSuperiorRule(int superiorRuleId)Removes the provided superior rule.DitStructureRule.BuilderruleId(int ruleId)Sets the the numeric ID which uniquely identifies this structure rule.DitStructureRule.BuildersuperiorRules(int... superiorRuleIds)Adds the provided superior rule identifiers.
-
-
-
Method Detail
-
addToSchema
public SchemaBuilder addToSchema()
Adds this DIT structure rule to the schema, throwing aConflictingSchemaElementExceptionif 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
public SchemaBuilder 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
public DitStructureRule.Builder description(String description)
Sets the description.- Parameters:
description- The description, which may benullin which case the empty string will be used.- Returns:
- This builder.
-
extraProperties
public DitStructureRule.Builder extraProperties(Map<String,List<String>> extraProperties)
Adds the provided collection of extended properties.- Parameters:
extraProperties- The collection of extended properties.- Returns:
- This builder.
-
extraProperties
public DitStructureRule.Builder extraProperties(String extensionName, String... extensionValues)
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
public DitStructureRule.Builder nameForm(String nameFormOID)
Sets the name form associated with the DIT structure rule.- Parameters:
nameFormOID- The name form numeric OID.- Returns:
- This builder.
-
names
public DitStructureRule.Builder names(Collection<String> names)
Adds the provided user friendly names.- Parameters:
names- The user friendly names.- Returns:
- This builder.
-
names
public DitStructureRule.Builder names(String... names)
Adds the provided user friendly names.- Parameters:
names- The user friendly names.- Returns:
- This builder.
-
obsolete
public DitStructureRule.Builder obsolete(boolean isObsolete)
Specifies whether this schema element is obsolete.- Parameters:
isObsolete-trueif this schema element is obsolete (default isfalse).- Returns:
- This builder.
-
removeAllExtraProperties
public DitStructureRule.Builder removeAllExtraProperties()
Removes all extra properties.- Returns:
- This builder.
-
removeAllNames
public DitStructureRule.Builder removeAllNames()
Removes all user defined names.- Returns:
- This builder.
-
removeAllSuperiorRules
public DitStructureRule.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
public DitStructureRule.Builder removeName(String name)
Removes the provided user defined name.- Parameters:
name- The user defined name to be removed.- Returns:
- This builder.
-
removeSuperiorRule
public DitStructureRule.Builder removeSuperiorRule(int superiorRuleId)
Removes the provided superior rule.- Parameters:
superiorRuleId- The superior rule ID to be removed.- Returns:
- This builder.
-
ruleId
public DitStructureRule.Builder ruleId(int ruleId)
Sets the the numeric ID which uniquely identifies this structure rule.- Parameters:
ruleId- The numeric ID.- Returns:
- This builder.
-
superiorRules
public DitStructureRule.Builder superiorRules(int... superiorRuleIds)
Adds the provided superior rule identifiers.- Parameters:
superiorRuleIds- Structure rule identifiers.- Returns:
- This builder.
-
-