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 SchemaBuilder
addToSchema()
Adds this DIT structure rule to the schema, throwing aConflictingSchemaElementException
if there is an existing DIT structure rule with the same numeric ID.SchemaBuilder
addToSchemaOverwrite()
Adds this DIT structure rule to the schema overwriting any existing DIT structure rule with the same numeric ID.DitStructureRule.Builder
description(String description)
Sets the description.DitStructureRule.Builder
extraProperties(String extensionName, String... extensionValues)
Adds the provided extended property.T
extraProperties(String extensionName, List<String> extensionValues)
Adds the provided extended property.DitStructureRule.Builder
extraProperties(Map<String,List<String>> extraProperties)
Adds the provided collection of extended properties.DitStructureRule.Builder
nameForm(String nameFormOID)
Sets the name form associated with the DIT structure rule.DitStructureRule.Builder
names(String... names)
Adds the provided user friendly names.DitStructureRule.Builder
names(Collection<String> names)
Adds the provided user friendly names.DitStructureRule.Builder
obsolete(boolean isObsolete)
Specifies whether this schema element is obsolete.DitStructureRule.Builder
removeAllExtraProperties()
Removes all extra properties.DitStructureRule.Builder
removeAllNames()
Removes all user defined names.DitStructureRule.Builder
removeAllSuperiorRules()
Removes all superior rules.DitStructureRule.Builder
removeExtraProperty(String extensionName, String... extensionValues)
Removes the specified extended property.DitStructureRule.Builder
removeName(String name)
Removes the provided user defined name.DitStructureRule.Builder
removeSuperiorRule(int superiorRuleId)
Removes the provided superior rule.DitStructureRule.Builder
ruleId(int ruleId)
Sets the the numeric ID which uniquely identifies this structure rule.DitStructureRule.Builder
superiorRules(int... superiorRuleIds)
Adds the provided superior rule identifiers.
-
-
-
Method Detail
-
addToSchema
public SchemaBuilder 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
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 benull
in 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
-true
if 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.
-
-