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/DITContentRule.java
@@ -23,6 +23,7 @@
 *
 *
 *      Copyright 2009 Sun Microsystems, Inc.
 *      Portions copyright 2011 ForgeRock AS
 */
package org.forgerock.opendj.ldap.schema;
@@ -42,7 +43,7 @@
/**
 * This class defines a DIT content rule, which defines the set of allowed,
 * required, and prohibited attributes for entries with a given structural
 * objectclass, and also indicates which auxiliary classes that may be included
 * objectclass, and also indicates which auxiliary classes may be included
 * in the entry.
 */
public final class DITContentRule extends SchemaElement
@@ -287,6 +288,55 @@
  /**
   * Indicates whether the provided attribute type is included in the optional
   * attribute list for this DIT content rule.
   *
   * @param attributeType
   *          The attribute type for which to make the determination.
   * @return <code>true</code> if the provided attribute type is optional for
   *         this DIT content rule, 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 DIT content rule.
   *
   * @param attributeType
   *          The attribute type for which to make the determination.
   * @return <code>true</code> if the provided attribute type is required by
   *         this DIT content rule, 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 DIT content rule.
   *
   * @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 DIT content rule, 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.
   *