Package org.forgerock.opendj.ldap.schema
Class NameForm
- java.lang.Object
-
- org.forgerock.opendj.ldap.schema.NameForm
-
- All Implemented Interfaces:
SchemaElement
public final class NameForm extends Object
This class defines a data structure for storing and interacting with a name form, which defines the attribute type(s) that must and/or may be used in the RDN of an entry with a given structural objectclass.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
NameForm.Builder
A fluent API for incrementally constructing name forms.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
equals(Object o)
Returnstrue
if the provided object is a name form having the same numeric OID as this name form.String
getDescription()
Returns the description of this schema element, or the empty string if it does not have a description.Map<String,List<String>>
getExtraProperties()
Returns an unmodifiable map containing all of the extra properties associated with this schema element.String
getNameOrOid()
Returns the name or numeric OID of this name form.List<String>
getNames()
Returns an unmodifiable list containing the user-friendly names that may be used to reference this name form.String
getOid()
Returns the numeric OID of this name form.Set<AttributeType>
getOptionalAttributes()
Returns an unmodifiable set containing the optional attributes of this name form.Set<AttributeType>
getRequiredAttributes()
Returns an unmodifiable set containing the required attributes of this name form.ObjectClass
getStructuralClass()
Returns the structural objectclass of this name form.int
hashCode()
Returns the hash code for this name form.boolean
hasName(String name)
Returnstrue
if this name form has the specified user-friendly name.boolean
hasNameOrOid(String nameOrOid)
Returnstrue
if this name form has the specified user-friendly name or numeric OID.boolean
isObsolete()
Returnstrue
if this name form is "obsolete".boolean
isOptional(AttributeType attributeType)
Returnstrue
if the provided attribute type is included in the list of optional attributes for this name form.boolean
isRequired(AttributeType attributeType)
Returnstrue
if the provided attribute type is included in the list of required attributes for this name form.boolean
isRequiredOrOptional(AttributeType attributeType)
Returnstrue
if the provided attribute type is included in the list of optional or required attributes for this name form.String
toString()
Returns the string representation of this schema element as defined in RFC 2252.
-
-
-
Method Detail
-
equals
public boolean equals(Object o)
Returnstrue
if the provided object is a name form having the same numeric OID as this name form.- Parameters:
o
- The object to be compared.- Returns:
true
if the provided object is a name form having the same numeric OID as this name form.
-
getNameOrOid
public String getNameOrOid()
Returns the name or numeric OID of this name form. If it has one or more names, then the primary name will be returned. If it does not have any names, then the numeric OID will be returned.- Returns:
- The name or numeric OID of this name form.
-
getNames
public List<String> getNames()
Returns an unmodifiable list containing the user-friendly names that may be used to reference this name form.- Returns:
- An unmodifiable list containing the user-friendly names that may be used to reference this name form.
-
getOid
public String getOid()
Returns the numeric OID of this name form.- Returns:
- The numeric OID of this name form.
-
getOptionalAttributes
public Set<AttributeType> getOptionalAttributes()
Returns an unmodifiable set containing the optional attributes of this name form.- Returns:
- An unmodifiable set containing the optional attributes of this name form.
-
getRequiredAttributes
public Set<AttributeType> getRequiredAttributes()
Returns an unmodifiable set containing the required attributes of this name form.- Returns:
- An unmodifiable set containing the required attributes of this name form.
-
getStructuralClass
public ObjectClass getStructuralClass()
Returns the structural objectclass of this name form.- Returns:
- The structural objectclass of this name form.
-
hashCode
public int hashCode()
Returns the hash code for this name form. It will be calculated as the hash code of the lowercase version of the numeric OID.- Returns:
- The hash code for this name form.
-
hasName
public boolean hasName(String name)
Returnstrue
if this name form has the specified user-friendly name.- Parameters:
name
- The name.- Returns:
true
if this name form has the specified user-friendly name.
-
hasNameOrOid
public boolean hasNameOrOid(String nameOrOid)
Returnstrue
if this name form has the specified user-friendly name or numeric OID.- Parameters:
nameOrOid
- The name or numeric OID.- Returns:
true
if this name form has the specified user-friendly name or numeric OID.
-
isObsolete
public boolean isObsolete()
Returnstrue
if this name form is "obsolete".- Returns:
true
if this name form is "obsolete".
-
isOptional
public boolean isOptional(AttributeType attributeType)
Returnstrue
if the provided attribute type is included in the list of optional attributes for this name form.- Parameters:
attributeType
- The attribute type.- Returns:
true
if the provided attribute type is included in the list of optional attributes for this name form.
-
isRequired
public boolean isRequired(AttributeType attributeType)
Returnstrue
if the provided attribute type is included in the list of required attributes for this name form.- Parameters:
attributeType
- The attribute type.- Returns:
true
if the provided attribute type is included in the list of required attributes for this name form.
-
isRequiredOrOptional
public boolean isRequiredOrOptional(AttributeType attributeType)
Returnstrue
if the provided attribute type is included in the list of optional or required attributes for this name form.- Parameters:
attributeType
- The attribute type.- Returns:
true
if the provided attribute type is included in the list of optional or required attributes for this name form.
-
getDescription
public final String 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
public final Map<String,List<String>> 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.
-
-