Package org.forgerock.opendj.ldap.schema
Class ObjectClass.Builder
- java.lang.Object
-
- org.forgerock.opendj.ldap.schema.ObjectClass.Builder
-
- Enclosing class:
- ObjectClass
public static final class ObjectClass.Builder extends Object
A fluent API for incrementally constructing object classes.
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description SchemaBuilderaddToSchema()Adds this object class to the schema, throwing aConflictingSchemaElementExceptionif there is an existing object class with the same numeric OID.SchemaBuilderaddToSchemaOverwrite()Adds this object class to the schema overwriting any existing object class with the same numeric OID.ObjectClass.Builderdescription(String description)Sets the description.ObjectClass.BuilderextraProperties(String extensionName, String... extensionValues)Adds the provided extended property.TextraProperties(String extensionName, List<String> extensionValues)Adds the provided extended property.ObjectClass.BuilderextraProperties(Map<String,List<String>> extraProperties)Adds the provided collection of extended properties.ObjectClass.Buildernames(String... names)Adds the provided user friendly names.ObjectClass.Buildernames(Collection<String> names)Adds the provided user friendly names.ObjectClass.Builderobsolete(boolean isObsolete)Specifies whether this schema element is obsolete.ObjectClass.Builderoid(String oid)Sets the numeric OID which uniquely identifies this object class.ObjectClass.BuilderoptionalAttributes(String... attributeNamesOrOids)Adds the provided optional attributes.ObjectClass.BuilderoptionalAttributes(Collection<String> attributeNamesOrOids)Adds the provided optional attributes.ObjectClass.BuilderremoveAllExtraProperties()Removes all extra properties.ObjectClass.BuilderremoveAllNames()Removes all user defined names.ObjectClass.BuilderremoveAllOptionalAttributes()Removes all optional attributes.ObjectClass.BuilderremoveAllRequiredAttributes()Removes all required attributes.ObjectClass.BuilderremoveAllSuperiorObjectClass()Removes all superior object class.ObjectClass.BuilderremoveExtraProperty(String extensionName, String... extensionValues)Removes the specified extended property.ObjectClass.BuilderremoveName(String name)Removes the provided user defined name.ObjectClass.BuilderremoveOptionalAttribute(String attributeNameOrOid)Removes the provided optional attribute.ObjectClass.BuilderremoveRequiredAttribute(String attributeNameOrOid)Removes the provided required attribute.ObjectClass.BuilderremoveSuperiorObjectClass(String objectClassNameOrOid)Removes the provided superior object class.ObjectClass.BuilderrequiredAttributes(String... attributeNamesOrOids)Adds the provided required attributes.ObjectClass.BuilderrequiredAttributes(Collection<String> attributeNamesOrOids)Adds the provided required attributes.ObjectClass.BuildersuperiorObjectClasses(String... objectClassNamesOrOids)Adds the provided superior object classes.ObjectClass.BuildersuperiorObjectClasses(Collection<String> objectClassNamesOrOids)Adds the provided superior object classes.ObjectClass.Buildertype(ObjectClassType type)Sets the type of this object class.
-
-
-
Method Detail
-
addToSchema
public SchemaBuilder addToSchema()
Adds this object class to the schema, throwing aConflictingSchemaElementExceptionif 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 benullin 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-trueif this schema element is obsolete (default isfalse).- 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.
-
type
public ObjectClass.Builder type(ObjectClassType type)
Sets the type of this object class.- Parameters:
type- The object class type.- Returns:
- This builder.
-
-