Class AttributeType.Builder

  • Enclosing class:
    AttributeType

    public static final class AttributeType.Builder
    extends Object
    A fluent API for incrementally constructing attribute type.
    • Method Detail

      • addToSchema

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

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

        public AttributeType.Builder approximateMatchingRule​(String approximateMatchingRuleOid)
        Sets the matching rule that should be used for approximate matching with this attribute type.
        Parameters:
        approximateMatchingRuleOid - The matching rule OID.
        Returns:
        This builder.
      • collective

        public AttributeType.Builder collective​(boolean isCollective)
        Specifies whether this attribute type is "collective".
        Parameters:
        isCollective - true if this attribute type is "collective".
        Returns:
        This builder.
      • description

        public AttributeType.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.
      • equalityMatchingRule

        public AttributeType.Builder equalityMatchingRule​(String equalityMatchingRuleOid)
        Sets the matching rule that should be used for equality matching with this attribute type.
        Parameters:
        equalityMatchingRuleOid - The matching rule OID.
        Returns:
        This builder.
      • extraProperties

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

        public AttributeType.Builder noUserModification​(boolean isNoUserModification)
        Specifies whether this attribute type is "no-user-modification".
        Parameters:
        isNoUserModification - true if this attribute type is "no-user-modification"
        Returns:
        This builder.
      • obsolete

        public AttributeType.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 AttributeType.Builder oid​(String oid)
        Sets the numeric OID which uniquely identifies this attribute type.
        Parameters:
        oid - The numeric OID.
        Returns:
        This builder.
      • orderingMatchingRule

        public AttributeType.Builder orderingMatchingRule​(String orderingMatchingRuleOid)
        Sets the matching rule that should be used for ordering with this attribute type.
        Parameters:
        orderingMatchingRuleOid - The matching rule OID.
        Returns:
        This Builder.
      • removeAllExtraProperties

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

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

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

        public AttributeType.Builder singleValue​(boolean isSingleValue)
        Specifies whether this attribute type is declared "single-value".
        Parameters:
        isSingleValue - true if this attribute type is declared "single-value".
        Returns:
        This builder.
      • substringMatchingRule

        public AttributeType.Builder substringMatchingRule​(String substringMatchingRuleOid)
        Sets the matching rule that should be used for substring matching with this attribute type.
        Parameters:
        substringMatchingRuleOid - The matching rule OID.
        Returns:
        This builder.
      • superiorType

        public AttributeType.Builder superiorType​(String superiorTypeOid)
        Sets the superior type for this attribute type.
        Parameters:
        superiorTypeOid - The superior type OID.
        Returns:
        This builder.
      • syntax

        public AttributeType.Builder syntax​(String syntaxOid)
        Sets the syntax for this attribute type.
        Parameters:
        syntaxOid - The syntax OID.
        Returns:
        This builder.
      • usage

        public AttributeType.Builder usage​(AttributeUsage attributeUsage)
        Sets the usage indicator for this attribute type.
        Parameters:
        attributeUsage - The attribute usage.
        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.