@NotMutable @ThreadSafety(level=COMPLETELY_THREADSAFE) public final class ObjectClassDefinition extends SchemaElement
Constructor and Description |
---|
ObjectClassDefinition(java.lang.String s)
Creates a new object class from the provided string representation.
|
ObjectClassDefinition(java.lang.String oid,
java.lang.String[] names,
java.lang.String description,
boolean isObsolete,
java.lang.String[] superiorClasses,
ObjectClassType objectClassType,
java.lang.String[] requiredAttributes,
java.lang.String[] optionalAttributes,
java.util.Map<java.lang.String,java.lang.String[]> extensions)
Creates a new object class with the provided information.
|
ObjectClassDefinition(java.lang.String oid,
java.lang.String name,
java.lang.String description,
java.lang.String superiorClass,
ObjectClassType objectClassType,
java.util.Collection<java.lang.String> requiredAttributes,
java.util.Collection<java.lang.String> optionalAttributes,
java.util.Map<java.lang.String,java.lang.String[]> extensions)
Creates a new object class with the provided information.
|
ObjectClassDefinition(java.lang.String oid,
java.lang.String name,
java.lang.String description,
java.lang.String superiorClass,
ObjectClassType objectClassType,
java.lang.String[] requiredAttributes,
java.lang.String[] optionalAttributes,
java.util.Map<java.lang.String,java.lang.String[]> extensions)
Creates a new object class with the provided information.
|
Modifier and Type | Method and Description |
---|---|
boolean |
equals(java.lang.Object o)
Indicates whether the provided object is equal to this schema element.
|
java.lang.String |
getDescription()
Retrieves the description for this object class, if available.
|
java.util.Map<java.lang.String,java.lang.String[]> |
getExtensions()
Retrieves the set of extensions for this object class.
|
java.lang.String |
getNameOrOID()
Retrieves the primary name that can be used to reference this object
class.
|
java.lang.String[] |
getNames()
Retrieves the set of names for this object class.
|
ObjectClassType |
getObjectClassType()
Retrieves the object class type for this object class.
|
ObjectClassType |
getObjectClassType(Schema schema)
Retrieves the object class type for this object class, recursively
examining superior classes if necessary to make the determination.
|
java.lang.String |
getOID()
Retrieves the OID for this object class.
|
java.lang.String[] |
getOptionalAttributes()
Retrieves the names or OIDs of the attributes that may optionally be
present in entries containing this object class.
|
java.util.Set<AttributeTypeDefinition> |
getOptionalAttributes(Schema schema,
boolean includeSuperiorClasses)
Retrieves the attribute type definitions for the attributes that may
optionally be present in entries containing this object class, optionally
including the set of optional attribute types from superior classes.
|
java.lang.String[] |
getRequiredAttributes()
Retrieves the names or OIDs of the attributes that are required to be
present in entries containing this object class.
|
java.util.Set<AttributeTypeDefinition> |
getRequiredAttributes(Schema schema,
boolean includeSuperiorClasses)
Retrieves the attribute type definitions for the attributes that are
required to be present in entries containing this object class, optionally
including the set of required attribute types from superior classes.
|
java.lang.String[] |
getSuperiorClasses()
Retrieves the names or OIDs of the superior classes for this object class,
if available.
|
java.util.Set<ObjectClassDefinition> |
getSuperiorClasses(Schema schema,
boolean recursive)
Retrieves the object class definitions for the superior object classes.
|
int |
hashCode()
Retrieves a hash code for this schema element.
|
boolean |
hasNameOrOID(java.lang.String s)
Indicates whether the provided string matches the OID or any of the names
for this object class.
|
boolean |
isObsolete()
Indicates whether this object class is declared obsolete.
|
java.lang.String |
toString()
Retrieves a string representation of this object class definition, in the
format described in RFC 4512 section 4.1.1.
|
extensionsEqual
public ObjectClassDefinition(java.lang.String s) throws LDAPException
s
- The string representation of the object class to create, using
the syntax described in RFC 4512 section 4.1.1. It must not be
null
.LDAPException
- If the provided string cannot be decoded as an
object class definition.public ObjectClassDefinition(java.lang.String oid, java.lang.String name, java.lang.String description, java.lang.String superiorClass, ObjectClassType objectClassType, java.lang.String[] requiredAttributes, java.lang.String[] optionalAttributes, java.util.Map<java.lang.String,java.lang.String[]> extensions)
oid
- The OID for this object class. It must not be
null
.name
- The name for this object class. It may be
null
if the object class should only be
referenced by OID.description
- The description for this object class. It may
be null
if there is no description.superiorClass
- The name/OID of the superior class for this
object class. It may be null
or
empty if there is no superior class.objectClassType
- The object class type for this object class.requiredAttributes
- The names/OIDs of the attributes which must be
present in entries containing this object
class.optionalAttributes
- The names/OIDs of the attributes which may be
present in entries containing this object
class.extensions
- The set of extensions for this object class.
It may be null
or empty if there should
not be any extensions.public ObjectClassDefinition(java.lang.String oid, java.lang.String name, java.lang.String description, java.lang.String superiorClass, ObjectClassType objectClassType, java.util.Collection<java.lang.String> requiredAttributes, java.util.Collection<java.lang.String> optionalAttributes, java.util.Map<java.lang.String,java.lang.String[]> extensions)
oid
- The OID for this object class. It must not be
null
.name
- The name for this object class. It may be
null
if the object class should only be
referenced by OID.description
- The description for this object class. It may
be null
if there is no description.superiorClass
- The name/OID of the superior class for this
object class. It may be null
or
empty if there is no superior class.objectClassType
- The object class type for this object class.requiredAttributes
- The names/OIDs of the attributes which must be
present in entries containing this object
class.optionalAttributes
- The names/OIDs of the attributes which may be
present in entries containing this object
class.extensions
- The set of extensions for this object class.
It may be null
or empty if there should
not be any extensions.public ObjectClassDefinition(java.lang.String oid, java.lang.String[] names, java.lang.String description, boolean isObsolete, java.lang.String[] superiorClasses, ObjectClassType objectClassType, java.lang.String[] requiredAttributes, java.lang.String[] optionalAttributes, java.util.Map<java.lang.String,java.lang.String[]> extensions)
oid
- The OID for this object class. It must not be
null
.names
- The set of names for this object class. It may
be null
or empty if the object class
should only be referenced by OID.description
- The description for this object class. It may
be null
if there is no description.isObsolete
- Indicates whether this object class is declared
obsolete.superiorClasses
- The names/OIDs of the superior classes for this
object class. It may be null
or
empty if there is no superior class.objectClassType
- The object class type for this object class.requiredAttributes
- The names/OIDs of the attributes which must be
present in entries containing this object
class.optionalAttributes
- The names/OIDs of the attributes which may be
present in entries containing this object
class.extensions
- The set of extensions for this object class.
It may be null
or empty if there should
not be any extensions.public java.lang.String getOID()
public java.lang.String[] getNames()
public java.lang.String getNameOrOID()
public boolean hasNameOrOID(java.lang.String s)
s
- The string for which to make the determination. It must not be
null
.true
if the provided string matches the OID or any of the
names for this object class, or false
if not.public java.lang.String getDescription()
null
if there is
no description defined.public boolean isObsolete()
true
if this object class is declared obsolete, or
false
if it is not.public java.lang.String[] getSuperiorClasses()
public java.util.Set<ObjectClassDefinition> getSuperiorClasses(Schema schema, boolean recursive)
schema
- The schema to use to retrieve the object class
definitions.recursive
- Indicates whether to recursively include all of the
superior object class definitions from superior classes.public ObjectClassType getObjectClassType()
null
if it
is not defined.public ObjectClassType getObjectClassType(Schema schema)
schema
- The schema to use to retrieve the definitions for the
superior object classes.public java.lang.String[] getRequiredAttributes()
public java.util.Set<AttributeTypeDefinition> getRequiredAttributes(Schema schema, boolean includeSuperiorClasses)
schema
- The schema to use to retrieve the
attribute type definitions.includeSuperiorClasses
- Indicates whether to include definitions
for required attribute types in superior
object classes.public java.lang.String[] getOptionalAttributes()
public java.util.Set<AttributeTypeDefinition> getOptionalAttributes(Schema schema, boolean includeSuperiorClasses)
schema
- The schema to use to retrieve the
attribute type definitions.includeSuperiorClasses
- Indicates whether to include definitions
for optional attribute types in superior
object classes.public java.util.Map<java.lang.String,java.lang.String[]> getExtensions()
public int hashCode()
hashCode
in class SchemaElement
public boolean equals(java.lang.Object o)
equals
in class SchemaElement
o
- The object for which to make the determination.true
if the provided object may be considered equal to
this schema element, or false
if not.public java.lang.String toString()
toString
in class SchemaElement