Package org.forgerock.opendj.ldap.schema
Class ObjectClass
java.lang.Object
org.forgerock.opendj.ldap.schema.ObjectClass
- All Implemented Interfaces:
SchemaElement
This class defines a data structure for storing and interacting with an
objectclass, which contains a collection of attributes that must and/or may
be present in an entry with that objectclass.
Where ordered sets of names, attribute types, or extra properties are
provided, the ordering will be preserved when the associated fields are
accessed via their getters or via the Object.toString()
methods.
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic final class
A fluent API for incrementally constructing object classes. -
Method Summary
Modifier and TypeMethodDescriptionboolean
Returnstrue
if the provided object is an object class having the same numeric OID as this object class.Returns an unmodifiable set containing the optional attributes for this object class.Returns an unmodifiable set containing the required attributes for this object class.final String
Returns the description of this schema element, or the empty string if it does not have a description.Returns an unmodifiable map containing all of the extra properties associated with this schema element.Returns the name or OID for this schema definition.getNames()
Returns an unmodifiable list containing the user-defined names that may be used to reference this schema definition.Returns the objectclass type for this objectclass.getOid()
Returns the OID for this schema definition.Returns an unmodifiable set containing the optional attributes for this object class and any superior object classes that it might have.Returns an unmodifiable set containing the required attributes for this object class and any superior object classes that it might have.Returns an unmodifiable set containing the superior classes for this object class.int
hashCode()
Returns the hash code for this object class.boolean
Indicates whether this schema definition has the specified name.boolean
hasNameOrOid
(String value) Indicates whether this schema definition has the specified name or OID.boolean
isDescendantOf
(ObjectClass objectClass) Indicates whether this objectclass is a descendant of the provided class.boolean
Indicates whether this object class is extensibleObject class.boolean
Indicates whether this schema definition is declared "obsolete".boolean
isOptional
(AttributeType attributeType) Indicates whether the provided attribute type is included in the optional attribute list for this or any of its superior objectclasses.boolean
Returns whether this object class is a placeholder, i.e.boolean
isRequired
(AttributeType attributeType) Indicates whether the provided attribute type is included in the required attribute list for this or any of its superior objectclasses.boolean
isRequiredOrOptional
(AttributeType attributeType) Indicates whether the provided attribute type is in the list of required or optional attributes for this objectclass or any of its superior classes.final String
toString()
Returns the string representation of this schema element as defined in RFC 2252.
-
Method Details
-
equals
Returnstrue
if the provided object is an object class having the same numeric OID as this object class.- Parameters:
o
- The object to be compared.- Returns:
true
if the provided object is a object class having the same numeric OID as this object class.
-
getDeclaredOptionalAttributes
Returns an unmodifiable set containing the optional attributes for this object class. Note that this set will not automatically include any optional attributes for superior object classes.- Returns:
- An unmodifiable set containing the optional attributes for this object class.
-
getDeclaredRequiredAttributes
Returns an unmodifiable set containing the required attributes for this object class. Note that this set will not automatically include any required attributes for superior object classes.- Returns:
- An unmodifiable set containing the required attributes for this object class.
-
getNameOrOid
Returns the name or OID for this schema definition. If it has one or more names, then the primary name will be returned. If it does not have any names, then the OID will be returned.- Returns:
- The name or OID for this schema definition.
-
getNames
Returns an unmodifiable list containing the user-defined names that may be used to reference this schema definition.- Returns:
- Returns an unmodifiable list containing the user-defined names that may be used to reference this schema definition.
-
getObjectClassType
Returns the objectclass type for this objectclass.- Returns:
- The objectclass type for this objectclass.
-
getOid
Returns the OID for this schema definition.- Returns:
- The OID for this schema definition.
-
getOptionalAttributes
Returns an unmodifiable set containing the optional attributes for this object class and any superior object classes that it might have.- Returns:
- An unmodifiable set containing the optional attributes for this object class and any superior object classes that it might have.
-
getRequiredAttributes
Returns an unmodifiable set containing the required attributes for this object class and any superior object classes that it might have.- Returns:
- An unmodifiable set containing the required attributes for this object class and any superior object classes that it might have.
-
getSuperiorClasses
Returns an unmodifiable set containing the superior classes for this object class.- Returns:
- An unmodifiable set containing the superior classes for this object class.
-
hashCode
public int hashCode()Returns the hash code for this object class. It will be calculated as the hash code of the numeric OID.- Returns:
- The hash code for this object class.
-
hasName
Indicates whether this schema definition has the specified name.- Parameters:
name
- The name for which to make the determination.- Returns:
true
if the specified name is assigned to this schema definition, orfalse
if not.
-
hasNameOrOid
Indicates whether this schema definition has the specified name or OID.- Parameters:
value
- The value for which to make the determination.- Returns:
true
if the provided value matches the OID or one of the names assigned to this schema definition, orfalse
if not.
-
isDescendantOf
Indicates whether this objectclass is a descendant of the provided class.- Parameters:
objectClass
- The objectClass for which to make the determination.- Returns:
true
if this objectclass is a descendant of the provided class, orfalse
if not.
-
isExtensible
public boolean isExtensible()Indicates whether this object class is extensibleObject class.An extensible object class has an optional attributes list corresponding to all the attributes types defined in the schema. It means any attribute type can be used with this object class.
- Returns:
true
if this object class is extensible.
-
isObsolete
public boolean isObsolete()Indicates whether this schema definition is declared "obsolete".- Returns:
true
if this schema definition is declared "obsolete", orfalse
if not.
-
isPlaceHolder
public boolean isPlaceHolder()Returns whether this object class is a placeholder, i.e. a dummy object class that does not exist in the schema.- Returns:
true
if this object class is a placeholder,false
otherwise
-
isOptional
Indicates whether the provided attribute type is included in the optional attribute list for this or any of its superior objectclasses.- Parameters:
attributeType
- The attribute type for which to make the determination.- Returns:
true
if the provided attribute type is optional for this objectclass or any of its superior classes, orfalse
if not.
-
isRequired
Indicates whether the provided attribute type is included in the required attribute list for this or any of its superior objectclasses.- Parameters:
attributeType
- The attribute type for which to make the determination.- Returns:
true
if the provided attribute type is required by this objectclass or any of its superior classes, orfalse
if not.
-
isRequiredOrOptional
Indicates whether the provided attribute type is in the list of required or optional attributes for this objectclass or any of its superior classes.- Parameters:
attributeType
- The attribute type for which to make the determination.- Returns:
true
if the provided attribute type is required or allowed for this objectclass or any of its superior classes, orfalse
if it is not.
-
getDescription
Description copied from interface:SchemaElement
Returns the description of this schema element, or the empty string if it does not have a description.- Specified by:
getDescription
in interfaceSchemaElement
- Returns:
- The description of this schema element, or the empty string if it does not have a description.
-
getExtraProperties
Description copied from interface:SchemaElement
Returns an unmodifiable map containing all of the extra properties associated with this schema element.- Specified by:
getExtraProperties
in interfaceSchemaElement
- Returns:
- An unmodifiable map containing all of the extra properties associated with this schema element.
-
toString
Returns the string representation of this schema element as defined in RFC 2252.
-