Package org.forgerock.opendj.ldap.schema
Class ObjectClass.Builder
java.lang.Object
org.forgerock.opendj.ldap.schema.ObjectClass.Builder
- Enclosing class:
- ObjectClass
A fluent API for incrementally constructing object classes.
-
Method Summary
Modifier and TypeMethodDescriptionAdds this object class to the schema, throwing aConflictingSchemaElementException
if there is an existing object class with the same numeric OID.Adds this object class to the schema overwriting any existing object class with the same numeric OID.description
(String description) Sets the description.extraProperties
(String extensionName, String... extensionValues) Adds the provided extended property.extraProperties
(String extensionName, List<String> extensionValues) Adds the provided extended property.extraProperties
(Map<String, List<String>> extraProperties) Adds the provided collection of extended properties.Adds the provided user friendly names.names
(Collection<String> names) Adds the provided user friendly names.obsolete
(boolean isObsolete) Specifies whether this schema element is obsolete.Sets the numeric OID which uniquely identifies this object class.optionalAttributes
(String... attributeNamesOrOids) Adds the provided optional attributes.optionalAttributes
(Collection<String> attributeNamesOrOids) Adds the provided optional attributes.Removes all extra properties.Removes all user defined names.Removes all optional attributes.Removes all required attributes.Removes all superior object class.removeExtraProperty
(String extensionName, String... extensionValues) Removes the specified extended property.removeName
(String name) Removes the provided user defined name.removeOptionalAttribute
(String attributeNameOrOid) Removes the provided optional attribute.removeRequiredAttribute
(String attributeNameOrOid) Removes the provided required attribute.removeSuperiorObjectClass
(String objectClassNameOrOid) Removes the provided superior object class.requiredAttributes
(String... attributeNamesOrOids) Adds the provided required attributes.requiredAttributes
(Collection<String> attributeNamesOrOids) Adds the provided required attributes.superiorObjectClasses
(String... objectClassNamesOrOids) Adds the provided superior object classes.superiorObjectClasses
(Collection<String> objectClassNamesOrOids) Adds the provided superior object classes.type
(ObjectClassType type) Sets the type of this object class.
-
Method Details
-
addToSchema
Adds this object class to the schema, throwing aConflictingSchemaElementException
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
Adds this object class to the schema overwriting any existing object class with the same numeric OID.- Returns:
- The parent schema builder.
-
description
Sets the description.- Parameters:
description
- The description, which may benull
in which case the empty string will be used.- Returns:
- This builder.
-
extraProperties
Adds the provided collection of extended properties.- Parameters:
extraProperties
- The collection of extended properties.- Returns:
- This builder.
-
extraProperties
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
Adds the provided user friendly names.- Parameters:
names
- The user friendly names.- Returns:
- This builder.
-
names
Adds the provided user friendly names.- Parameters:
names
- The user friendly names.- Returns:
- This builder.
-
obsolete
Specifies whether this schema element is obsolete.- Parameters:
isObsolete
-true
if this schema element is obsolete (default isfalse
).- Returns:
- This builder.
-
oid
Sets the numeric OID which uniquely identifies this object class.- Parameters:
oid
- The numeric OID.- Returns:
- This builder.
-
optionalAttributes
Adds the provided optional attributes.- Parameters:
attributeNamesOrOids
- The list of optional attribute names or OIDs.- Returns:
- This builder.
-
optionalAttributes
Adds the provided optional attributes.- Parameters:
attributeNamesOrOids
- The list of optional attribute names or OIDs.- Returns:
- This builder.
-
removeAllExtraProperties
Removes all extra properties.- Returns:
- This builder.
-
removeExtraProperty
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
Removes all user defined names.- Returns:
- This builder.
-
removeAllOptionalAttributes
Removes all optional attributes.- Returns:
- This builder.
-
removeAllRequiredAttributes
Removes all required attributes.- Returns:
- This builder.
-
removeAllSuperiorObjectClass
Removes all superior object class.- Returns:
- This builder.
-
removeName
Removes the provided user defined name.- Parameters:
name
- The user defined name to be removed.- Returns:
- This builder.
-
removeOptionalAttribute
Removes the provided optional attribute.- Parameters:
attributeNameOrOid
- The optional attribute name or OID to be removed.- Returns:
- This builder.
-
removeRequiredAttribute
Removes the provided required attribute.- Parameters:
attributeNameOrOid
- The provided required attribute name or OID to be removed.- Returns:
- This builder.
-
removeSuperiorObjectClass
Removes the provided superior object class.- Parameters:
objectClassNameOrOid
- The superior object class name or OID to be removed.- Returns:
- This builder.
-
requiredAttributes
Adds the provided required attributes.- Parameters:
attributeNamesOrOids
- The list of required attribute names or OIDs.- Returns:
- This builder.
-
requiredAttributes
Adds the provided required attributes.- Parameters:
attributeNamesOrOids
- The list of required attribute names or OIDs.- Returns:
- This builder.
-
superiorObjectClasses
Adds the provided superior object classes.- Parameters:
objectClassNamesOrOids
- The list of superior object classes names or OIDs.- Returns:
- This builder.
-
superiorObjectClasses
Adds the provided superior object classes.- Parameters:
objectClassNamesOrOids
- The list of superior object classes names or OIDs.- Returns:
- This builder.
-
type
Sets the type of this object class.- Parameters:
type
- The object class type.- Returns:
- This builder.
-
extraProperties
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.
-