Class NameForm.Builder

  • Enclosing class:
    NameForm

    public static final class NameForm.Builder
    extends Object
    A fluent API for incrementally constructing name forms.
    • Method Detail

      • addToSchema

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

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

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

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

        public NameForm.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 NameForm.Builder oid​(String oid)
        Sets the numeric OID which uniquely identifies this name form.
        Parameters:
        oid - The numeric OID.
        Returns:
        This builder.
      • optionalAttributes

        public NameForm.Builder optionalAttributes​(Collection<String> nameOrOids)
        Adds the provided optional attributes.
        Parameters:
        nameOrOids - The list of optional attributes.
        Returns:
        This builder.
      • optionalAttributes

        public NameForm.Builder optionalAttributes​(String... nameOrOids)
        Adds the provided optional attributes.
        Parameters:
        nameOrOids - The list of optional attributes.
        Returns:
        This builder.
      • removeAllExtraProperties

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

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

        public NameForm.Builder removeAllOptionalAttributes()
        Removes all optional attributes.
        Returns:
        This builder.
      • removeAllRequiredAttributes

        public NameForm.Builder removeAllRequiredAttributes()
        Removes all required attributes.
        Returns:
        This builder.
      • removeExtraProperty

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

        public NameForm.Builder removeOptionalAttribute​(String nameOrOid)
        Removes the specified optional attribute.
        Parameters:
        nameOrOid - The optional attribute to be removed.
        Returns:
        This builder.
      • removeRequiredAttribute

        public NameForm.Builder removeRequiredAttribute​(String nameOrOid)
        Removes the specified required attribute.
        Parameters:
        nameOrOid - The required attribute to be removed.
        Returns:
        This builder.
      • requiredAttributes

        public NameForm.Builder requiredAttributes​(Collection<String> nameOrOids)
        Adds the provided required attributes.
        Parameters:
        nameOrOids - The list of required attributes.
        Returns:
        This builder.
      • requiredAttributes

        public NameForm.Builder requiredAttributes​(String... nameOrOids)
        Adds the provided required attributes.
        Parameters:
        nameOrOids - The list of required attributes.
        Returns:
        This builder.
      • structuralObjectClassOid

        public NameForm.Builder structuralObjectClassOid​(String nameOrOid)
        Sets the structural object class.
        Parameters:
        nameOrOid - The structural object class.
        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.