Class MatchingRuleUse.Builder

java.lang.Object
org.forgerock.opendj.ldap.schema.MatchingRuleUse.Builder
Enclosing class:
MatchingRuleUse

public static final class MatchingRuleUse.Builder extends Object
A fluent API for incrementally constructing matching rule uses.
  • Method Details

    • addToSchema

      public SchemaBuilder addToSchema()
      Adds this matching rule use definition to the schema, throwing a ConflictingSchemaElementException if there is an existing matching rule definition with the same numeric OID.
      Returns:
      The parent schema builder.
      Throws:
      ConflictingSchemaElementException - If there is an existing matching rule use definition with the same numeric OID.
    • addToSchemaOverwrite

      public SchemaBuilder addToSchemaOverwrite()
      Adds this matching rule use definition to the schema overwriting any existing matching rule use definition with the same numeric OID.
      Returns:
      The parent schema builder.
    • attributes

      public MatchingRuleUse.Builder attributes(Collection<String> attributeOids)
      Adds the provided list of attribute types to the list of attribute type the matching rule applies to.
      Parameters:
      attributeOids - The list of attribute type numeric OIDs.
      Returns:
      This builder.
    • attributes

      public MatchingRuleUse.Builder attributes(String... attributeOids)
      Adds the provided list of attribute types to the list of attribute type the matching rule applies to.
      Parameters:
      attributeOids - The list of attribute type numeric OIDs.
      Returns:
      This builder.
    • description

      public MatchingRuleUse.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 MatchingRuleUse.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 MatchingRuleUse.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.
    • names

      public MatchingRuleUse.Builder names(Collection<String> names)
      Adds the provided user friendly names.
      Parameters:
      names - The user friendly names.
      Returns:
      This builder.
    • names

      public MatchingRuleUse.Builder names(String... names)
      Adds the provided user friendly names.
      Parameters:
      names - The user friendly names.
      Returns:
      This builder.
    • obsolete

      public MatchingRuleUse.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.
    • oid

      public MatchingRuleUse.Builder oid(String oid)
      Sets the numeric OID which uniquely identifies this matching rule use definition.
      Parameters:
      oid - The numeric OID.
      Returns:
      This builder.
    • removeAllAttributes

      public MatchingRuleUse.Builder removeAllAttributes()
      Removes all attribute types the matching rule applies to.
      Returns:
      This builder.
    • removeAllExtraProperties

      public MatchingRuleUse.Builder removeAllExtraProperties()
      Removes all extra properties.
      Returns:
      This builder.
    • removeAllNames

      public MatchingRuleUse.Builder removeAllNames()
      Removes all user defined names.
      Returns:
      This builder.
    • removeAttribute

      public MatchingRuleUse.Builder removeAttribute(String attributeOid)
      Removes the provided attribute type.
      Parameters:
      attributeOid - The attribute type OID to be removed.
      Returns:
      This builder.
    • removeExtraProperty

      public MatchingRuleUse.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 MatchingRuleUse.Builder removeName(String name)
      Removes the provided user defined name.
      Parameters:
      name - The user defined name to be removed.
      Returns:
      This builder.
    • extraProperties

      public MatchingRuleUse.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.