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 final class 
    A fluent API for incrementally constructing name forms.
  • Method Summary

    Modifier and Type
    Method
    Description
    boolean
    Returns true if the provided object is a name form having the same numeric OID as this name form.
    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 numeric OID of this name form.
    Returns an unmodifiable list containing the user-friendly names that may be used to reference this name form.
    Returns the numeric OID of this name form.
    Returns an unmodifiable set containing the optional attributes of this name form.
    Returns an unmodifiable set containing the required attributes of this name form.
    Returns the structural objectclass of this name form.
    int
    Returns the hash code for this name form.
    boolean
    Returns true if this name form has the specified user-friendly name.
    boolean
    hasNameOrOid(String nameOrOid)
    Returns true if this name form has the specified user-friendly name or numeric OID.
    boolean
    Returns true if this name form is "obsolete".
    boolean
    isOptional(AttributeType attributeType)
    Returns true if the provided attribute type is included in the list of optional attributes for this name form.
    boolean
    isRequired(AttributeType attributeType)
    Returns true if the provided attribute type is included in the list of required attributes for this name form.
    boolean
    Returns true if the provided attribute type is included in the list of optional or required attributes for this name form.
    final String
    Returns the string representation of this schema element as defined in RFC 2252.

    Methods inherited from class java.lang.Object

    clone, finalize, getClass, notify, notifyAll, wait, wait, wait
  • Method Details

    • equals

      public boolean equals(Object o)
      Returns true 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)
      Returns true 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)
      Returns true 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()
      Returns true if this name form is "obsolete".
      Returns:
      true if this name form is "obsolete".
    • isOptional

      public boolean isOptional(AttributeType attributeType)
      Returns true 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)
      Returns true 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)
      Returns true 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 interface SchemaElement
      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 interface SchemaElement
      Returns:
      An unmodifiable map containing all of the extra properties associated with this schema element.
    • toString

      public final String toString()
      Returns the string representation of this schema element as defined in RFC 2252.
      Overrides:
      toString in class Object
      Returns:
      The string representation of this schema element as defined in RFC 2252.