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 classNameForm.BuilderA fluent API for incrementally constructing name forms.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanequals(Object o)Returnstrueif the provided object is a name form having the same numeric OID as this name form.StringgetDescription()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.StringgetNameOrOid()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.StringgetOid()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.ObjectClassgetStructuralClass()Returns the structural objectclass of this name form.inthashCode()Returns the hash code for this name form.booleanhasName(String name)Returnstrueif this name form has the specified user-friendly name.booleanhasNameOrOid(String nameOrOid)Returnstrueif this name form has the specified user-friendly name or numeric OID.booleanisObsolete()Returnstrueif this name form is "obsolete".booleanisOptional(AttributeType attributeType)Returnstrueif the provided attribute type is included in the list of optional attributes for this name form.booleanisRequired(AttributeType attributeType)Returnstrueif the provided attribute type is included in the list of required attributes for this name form.booleanisRequiredOrOptional(AttributeType attributeType)Returnstrueif the provided attribute type is included in the list of optional or required attributes for this name form.StringtoString()Returns the string representation of this schema element as defined in RFC 2252.
-
-
-
Method Detail
-
equals
public boolean equals(Object o)
Returnstrueif the provided object is a name form having the same numeric OID as this name form.- Parameters:
o- The object to be compared.- Returns:
trueif 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)
Returnstrueif this name form has the specified user-friendly name.- Parameters:
name- The name.- Returns:
trueif this name form has the specified user-friendly name.
-
hasNameOrOid
public boolean hasNameOrOid(String nameOrOid)
Returnstrueif this name form has the specified user-friendly name or numeric OID.- Parameters:
nameOrOid- The name or numeric OID.- Returns:
trueif this name form has the specified user-friendly name or numeric OID.
-
isObsolete
public boolean isObsolete()
Returnstrueif this name form is "obsolete".- Returns:
trueif this name form is "obsolete".
-
isOptional
public boolean isOptional(AttributeType attributeType)
Returnstrueif the provided attribute type is included in the list of optional attributes for this name form.- Parameters:
attributeType- The attribute type.- Returns:
trueif the provided attribute type is included in the list of optional attributes for this name form.
-
isRequired
public boolean isRequired(AttributeType attributeType)
Returnstrueif the provided attribute type is included in the list of required attributes for this name form.- Parameters:
attributeType- The attribute type.- Returns:
trueif the provided attribute type is included in the list of required attributes for this name form.
-
isRequiredOrOptional
public boolean isRequiredOrOptional(AttributeType attributeType)
Returnstrueif the provided attribute type is included in the list of optional or required attributes for this name form.- Parameters:
attributeType- The attribute type.- Returns:
trueif 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:SchemaElementReturns the description of this schema element, or the empty string if it does not have a description.- Specified by:
getDescriptionin 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:SchemaElementReturns an unmodifiable map containing all of the extra properties associated with this schema element.- Specified by:
getExtraPropertiesin interfaceSchemaElement- Returns:
- An unmodifiable map containing all of the extra properties associated with this schema element.
-
-