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 Details

    • addToSchema

      public SchemaBuilder addToSchema()
      Adds this DIT structure rule to the schema, throwing a ConflictingSchemaElementException 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 be null 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

      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 is false).
      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 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.
    • extraProperties

      public DitStructureRule.Builder extraProperties(String extensionName, List<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.