mirror of https://github.com/OpenIdentityPlatform/OpenDJ.git

Matthew Swift
24.57.2011 a849a42d97109bc9242c50c7abbd9857e865bb5e
opendj3/opendj-ldap-sdk/src/main/java/org/forgerock/opendj/ldap/schema/NameForm.java
@@ -23,6 +23,7 @@
 *
 *
 *      Copyright 2009 Sun Microsystems, Inc.
 *      Portions copyright 2011 ForgeRock AS
 */
package org.forgerock.opendj.ldap.schema;
@@ -250,6 +251,55 @@
  /**
   * Indicates whether the provided attribute type is included in the optional
   * attribute list for this name form.
   *
   * @param attributeType
   *          The attribute type for which to make the determination.
   * @return <code>true</code> if the provided attribute type is optional for
   *         this name form, or <code>false</code> if not.
   */
  public boolean isOptional(final AttributeType attributeType)
  {
    return optionalAttributes.contains(attributeType);
  }
  /**
   * Indicates whether the provided attribute type is included in the required
   * attribute list for this name form.
   *
   * @param attributeType
   *          The attribute type for which to make the determination.
   * @return <code>true</code> if the provided attribute type is required by
   *         this name form, or <code>false</code> if not.
   */
  public boolean isRequired(final AttributeType attributeType)
  {
    return requiredAttributes.contains(attributeType);
  }
  /**
   * Indicates whether the provided attribute type is in the list of required or
   * optional attributes for this name form.
   *
   * @param attributeType
   *          The attribute type for which to make the determination.
   * @return <code>true</code> if the provided attribute type is required or
   *         allowed for this name form, or <code>false</code> if it is
   *         not.
   */
  public boolean isRequiredOrOptional(final AttributeType attributeType)
  {
    return isRequired(attributeType) || isOptional(attributeType);
  }
  /**
   * Returns the string representation of this schema definition in the form
   * specified in RFC 2252.
   *