Class ObjectClass.Builder

  • Enclosing class:
    ObjectClass

    public static final class ObjectClass.Builder
    extends Object
    A fluent API for incrementally constructing object classes.
    • Method Detail

      • addToSchema

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

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

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

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

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

        public ObjectClass.Builder optionalAttributes​(Collection<String> attributeNamesOrOids)
        Adds the provided optional attributes.
        Parameters:
        attributeNamesOrOids - The list of optional attribute names or OIDs.
        Returns:
        This builder.
      • optionalAttributes

        public ObjectClass.Builder optionalAttributes​(String... attributeNamesOrOids)
        Adds the provided optional attributes.
        Parameters:
        attributeNamesOrOids - The list of optional attribute names or OIDs.
        Returns:
        This builder.
      • removeAllExtraProperties

        public ObjectClass.Builder removeAllExtraProperties()
        Removes all extra properties.
        Returns:
        This builder.
      • removeExtraProperty

        public ObjectClass.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.
      • removeAllNames

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

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

        public ObjectClass.Builder removeAllRequiredAttributes()
        Removes all required attributes.
        Returns:
        This builder.
      • removeAllSuperiorObjectClass

        public ObjectClass.Builder removeAllSuperiorObjectClass()
        Removes all superior object class.
        Returns:
        This builder.
      • removeName

        public ObjectClass.Builder removeName​(String name)
        Removes the provided user defined name.
        Parameters:
        name - The user defined name to be removed.
        Returns:
        This builder.
      • removeOptionalAttribute

        public ObjectClass.Builder removeOptionalAttribute​(String attributeNameOrOid)
        Removes the provided optional attribute.
        Parameters:
        attributeNameOrOid - The optional attribute name or OID to be removed.
        Returns:
        This builder.
      • removeRequiredAttribute

        public ObjectClass.Builder removeRequiredAttribute​(String attributeNameOrOid)
        Removes the provided required attribute.
        Parameters:
        attributeNameOrOid - The provided required attribute name or OID to be removed.
        Returns:
        This builder.
      • removeSuperiorObjectClass

        public ObjectClass.Builder removeSuperiorObjectClass​(String objectClassNameOrOid)
        Removes the provided superior object class.
        Parameters:
        objectClassNameOrOid - The superior object class name or OID to be removed.
        Returns:
        This builder.
      • requiredAttributes

        public ObjectClass.Builder requiredAttributes​(Collection<String> attributeNamesOrOids)
        Adds the provided required attributes.
        Parameters:
        attributeNamesOrOids - The list of required attribute names or OIDs.
        Returns:
        This builder.
      • requiredAttributes

        public ObjectClass.Builder requiredAttributes​(String... attributeNamesOrOids)
        Adds the provided required attributes.
        Parameters:
        attributeNamesOrOids - The list of required attribute names or OIDs.
        Returns:
        This builder.
      • superiorObjectClasses

        public ObjectClass.Builder superiorObjectClasses​(Collection<String> objectClassNamesOrOids)
        Adds the provided superior object classes.
        Parameters:
        objectClassNamesOrOids - The list of superior object classes names or OIDs.
        Returns:
        This builder.
      • superiorObjectClasses

        public ObjectClass.Builder superiorObjectClasses​(String... objectClassNamesOrOids)
        Adds the provided superior object classes.
        Parameters:
        objectClassNamesOrOids - The list of superior object classes names or OIDs.
        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.