Class MatchingRule.Builder

  • Enclosing class:
    MatchingRule

    public static final class MatchingRule.Builder
    extends Object
    A fluent API for incrementally constructing matching rules.
    • Method Detail

      • addToSchema

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

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

        public MatchingRule.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 MatchingRule.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 MatchingRule.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 MatchingRule.Builder names​(Collection<String> names)
        Adds the provided user friendly names.
        Parameters:
        names - The user friendly names.
        Returns:
        This builder.
      • names

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

        public MatchingRule.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 MatchingRule.Builder oid​(String oid)
        Sets the numeric OID which uniquely identifies this matching rule.
        Parameters:
        oid - The numeric OID.
        Returns:
        This builder.
      • syntaxOid

        public MatchingRule.Builder syntaxOid​(String syntax)
        Sets the syntax OID of this matching rule.
        Parameters:
        syntax - The syntax OID.
        Returns:
        This builder.
      • implementation

        public MatchingRule.Builder implementation​(MatchingRuleImpl implementation)
        Sets the matching rule implementation.
        Parameters:
        implementation - The matching rule implementation.
        Returns:
        This builder.
      • removeAllExtraProperties

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

        public MatchingRule.Builder removeAllNames()
        Removes all user friendly names.
        Returns:
        This builder.
      • removeExtraProperty

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

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