Package org.forgerock.opendj.ldap.schema
Class MatchingRule.Builder
- java.lang.Object
-
- org.forgerock.opendj.ldap.schema.MatchingRule.Builder
-
- Enclosing class:
- MatchingRule
public static final class MatchingRule.Builder extends Object
A fluent API for incrementally constructing matching rules.
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description SchemaBuilder
addToSchema()
Adds this matching rule to the schema, throwing aConflictingSchemaElementException
if there is an existing matching rule with the same numeric OID.SchemaBuilder
addToSchemaOverwrite()
Adds this matching rule to the schema overwriting any existing matching rule with the same numeric OID.MatchingRule.Builder
description(String description)
Sets the description.MatchingRule.Builder
extraProperties(String extensionName, String... extensionValues)
Adds the provided extended property.T
extraProperties(String extensionName, List<String> extensionValues)
Adds the provided extended property.MatchingRule.Builder
extraProperties(Map<String,List<String>> extraProperties)
Adds the provided collection of extended properties.MatchingRule.Builder
implementation(MatchingRuleImpl implementation)
Sets the matching rule implementation.MatchingRule.Builder
names(String... names)
Adds the provided user friendly names.MatchingRule.Builder
names(Collection<String> names)
Adds the provided user friendly names.MatchingRule.Builder
obsolete(boolean isObsolete)
Specifies whether this schema element is obsolete.MatchingRule.Builder
oid(String oid)
Sets the numeric OID which uniquely identifies this matching rule.MatchingRule.Builder
removeAllExtraProperties()
Removes all extra properties.MatchingRule.Builder
removeAllNames()
Removes all user friendly names.MatchingRule.Builder
removeExtraProperty(String extensionName, String... extensionValues)
Removes the specified extended property.MatchingRule.Builder
removeName(String name)
Removes the provided user friendly name.MatchingRule.Builder
syntaxOid(String syntax)
Sets the syntax OID of this matching rule.
-
-
-
Method Detail
-
addToSchema
public SchemaBuilder addToSchema()
Adds this matching rule to the schema, throwing aConflictingSchemaElementException
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 benull
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 isfalse
).- 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.
-
-