Class AttributeTypeDefinition

java.lang.Object
com.unboundid.ldap.sdk.schema.SchemaElement
com.unboundid.ldap.sdk.schema.AttributeTypeDefinition
All Implemented Interfaces:
Serializable

This class provides a data structure that describes an LDAP attribute type schema element.
See Also:
  • Constructor Details

    • AttributeTypeDefinition

      Creates a new attribute type from the provided string representation.
      Parameters:
      s - The string representation of the attribute type to create, using the syntax described in RFC 4512 section 4.1.2. It must not be null.
      Throws:
      LDAPException - If the provided string cannot be decoded as an attribute type definition.
    • AttributeTypeDefinition

      public AttributeTypeDefinition(@NotNull String oid, @Nullable String name, @Nullable String description, @Nullable String equalityMatchingRule, @Nullable String orderingMatchingRule, @Nullable String substringMatchingRule, @Nullable String syntaxOID, boolean isSingleValued, @Nullable Map<String,String[]> extensions)
      Creates a new attribute type with the provided information.
      Parameters:
      oid - The OID for this attribute type. It must not be null.
      name - The name for this attribute type. It may be null if the attribute type should only be referenced by OID.
      description - The description for this attribute type. It may be null if there is no description.
      equalityMatchingRule - The name or OID of the equality matching rule for this attribute type. It may be null if a default rule is to be inherited.
      orderingMatchingRule - The name or OID of the ordering matching rule for this attribute type. It may be null if a default rule is to be inherited.
      substringMatchingRule - The name or OID of the substring matching rule for this attribute type. It may be null if a default rule is to be inherited.
      syntaxOID - The syntax OID for this attribute type. It may be null if a default syntax is to be inherited.
      isSingleValued - Indicates whether attributes of this type are only allowed to have a single value.
      extensions - The set of extensions for this attribute type. It may be null or empty if there should not be any extensions.
    • AttributeTypeDefinition

      public AttributeTypeDefinition(@NotNull String oid, @Nullable String[] names, @Nullable String description, boolean isObsolete, @Nullable String superiorType, @Nullable String equalityMatchingRule, @Nullable String orderingMatchingRule, @Nullable String substringMatchingRule, @Nullable String syntaxOID, boolean isSingleValued, boolean isCollective, boolean isNoUserModification, @Nullable AttributeUsage usage, @Nullable Map<String,String[]> extensions)
      Creates a new attribute type with the provided information.
      Parameters:
      oid - The OID for this attribute type. It must not be null.
      names - The set of names for this attribute type. It may be null or empty if the attribute type should only be referenced by OID.
      description - The description for this attribute type. It may be null if there is no description.
      isObsolete - Indicates whether this attribute type is declared obsolete.
      superiorType - The name or OID of the superior attribute type. It may be null if there is no superior type.
      equalityMatchingRule - The name or OID of the equality matching rule for this attribute type. It may be null if a default rule is to be inherited.
      orderingMatchingRule - The name or OID of the ordering matching rule for this attribute type. It may be null if a default rule is to be inherited.
      substringMatchingRule - The name or OID of the substring matching rule for this attribute type. It may be null if a default rule is to be inherited.
      syntaxOID - The syntax OID for this attribute type. It may be null if a default syntax is to be inherited.
      isSingleValued - Indicates whether attributes of this type are only allowed to have a single value.
      isCollective - Indicates whether this attribute type should be considered collective.
      isNoUserModification - Indicates whether clients should be allowed to modify attributes of this type.
      usage - The attribute usage for this attribute type. It may be null if the default usage of userApplications is to be used.
      extensions - The set of extensions for this attribute type. It may be null or empty if there should not be any extensions.
  • Method Details

    • getOID

      Retrieves the OID for this attribute type.
      Returns:
      The OID for this attribute type.
    • getNames

      @NotNull public String[] getNames()
      Retrieves the set of names for this attribute type.
      Returns:
      The set of names for this attribute type, or an empty array if it does not have any names.
    • getNameOrOID

      Retrieves the primary name that can be used to reference this attribute type. If one or more names are defined, then the first name will be used. Otherwise, the OID will be returned.
      Returns:
      The primary name that can be used to reference this attribute type.
    • hasNameOrOID

      public boolean hasNameOrOID(@NotNull String s)
      Indicates whether the provided string matches the OID or any of the names for this attribute type.
      Parameters:
      s - The string for which to make the determination. It must not be null.
      Returns:
      true if the provided string matches the OID or any of the names for this attribute type, or false if not.
    • getDescription

      Retrieves the description for this attribute type, if available.
      Returns:
      The description for this attribute type, or null if there is no description defined.
    • isObsolete

      public boolean isObsolete()
      Indicates whether this attribute type is declared obsolete.
      Returns:
      true if this attribute type is declared obsolete, or false if it is not.
    • getSuperiorType

      Retrieves the name or OID of the superior type for this attribute type, if available.
      Returns:
      The name or OID of the superior type for this attribute type, or null if no superior type is defined.
    • getSuperiorType

      Retrieves the superior attribute type definition for this attribute type, if available.
      Parameters:
      schema - The schema to use to get the superior attribute type.
      Returns:
      The superior attribute type definition for this attribute type, or null if no superior type is defined, or if the superior type is not included in the provided schema.
    • getEqualityMatchingRule

      Retrieves the name or OID of the equality matching rule for this attribute type, if available.
      Returns:
      The name or OID of the equality matching rule for this attribute type, or null if no equality matching rule is defined or a default rule will be inherited.
    • getEqualityMatchingRule

      Retrieves the name or OID of the equality matching rule for this attribute type, examining superior attribute types if necessary.
      Parameters:
      schema - The schema to use to get the superior attribute type.
      Returns:
      The name or OID of the equality matching rule for this attribute type, or null if no equality matching rule is defined.
    • getOrderingMatchingRule

      Retrieves the name or OID of the ordering matching rule for this attribute type, if available.
      Returns:
      The name or OID of the ordering matching rule for this attribute type, or null if no ordering matching rule is defined or a default rule will be inherited.
    • getOrderingMatchingRule

      Retrieves the name or OID of the ordering matching rule for this attribute type, examining superior attribute types if necessary.
      Parameters:
      schema - The schema to use to get the superior attribute type.
      Returns:
      The name or OID of the ordering matching rule for this attribute type, or null if no ordering matching rule is defined.
    • getSubstringMatchingRule

      Retrieves the name or OID of the substring matching rule for this attribute type, if available.
      Returns:
      The name or OID of the substring matching rule for this attribute type, or null if no substring matching rule is defined or a default rule will be inherited.
    • getSubstringMatchingRule

      Retrieves the name or OID of the substring matching rule for this attribute type, examining superior attribute types if necessary.
      Parameters:
      schema - The schema to use to get the superior attribute type.
      Returns:
      The name or OID of the substring matching rule for this attribute type, or null if no substring matching rule is defined.
    • getSyntaxOID

      Retrieves the OID of the syntax for this attribute type, if available. It may optionally include a minimum upper bound in curly braces.
      Returns:
      The OID of the syntax for this attribute type, or null if the syntax will be inherited.
    • getSyntaxOID

      Retrieves the OID of the syntax for this attribute type, examining superior types if necessary. It may optionally include a minimum upper bound in curly braces.
      Parameters:
      schema - The schema to use to get the superior attribute type.
      Returns:
      The OID of the syntax for this attribute type, or null if no syntax is defined.
    • getBaseSyntaxOID

      Retrieves the OID of the syntax for this attribute type, if available. If the attribute type definition includes a minimum upper bound in curly braces, it will be removed from the value that is returned.
      Returns:
      The OID of the syntax for this attribute type, or null if the syntax will be inherited.
    • getBaseSyntaxOID

      Retrieves the base OID of the syntax for this attribute type, examining superior types if necessary. If the attribute type definition includes a minimum upper bound in curly braces, it will be removed from the value that is returned.
      Parameters:
      schema - The schema to use to get the superior attribute type, if necessary.
      Returns:
      The OID of the syntax for this attribute type, or null if no syntax is defined.
    • getBaseSyntaxOID

      @Nullable public static String getBaseSyntaxOID(@Nullable String syntaxOID)
      Retrieves the base OID of the syntax for this attribute type, examining superior types if necessary. If the attribute type definition includes a minimum upper bound in curly braces, it will be removed from the value that is returned.
      Parameters:
      syntaxOID - The syntax OID (optionally including the minimum upper bound element) to examine.
      Returns:
      The OID of the syntax for this attribute type, or null if no syntax is defined.
    • getSyntaxMinimumUpperBound

      Retrieves the value of the minimum upper bound element of the syntax definition for this attribute type, if defined. If a minimum upper bound is present (as signified by an integer value in curly braces immediately following the syntax OID without any space between them), then it should serve as an indication to the directory server that it should be prepared to handle values with at least that number of (possibly multi-byte) characters.
      Returns:
      The value of the minimum upper bound element of the syntax definition for this attribute type, or -1 if no syntax is defined defined or if it does not have a valid minimum upper bound.
    • getSyntaxMinimumUpperBound

      Retrieves the value of the minimum upper bound element of the syntax definition for this attribute type, if defined. If a minimum upper bound is present (as signified by an integer value in curly braces immediately following the syntax OID without any space between them), then it should serve as an indication to the directory server that it should be prepared to handle values with at least that number of (possibly multi-byte) characters.
      Parameters:
      schema - The schema to use to get the superior attribute type, if necessary.
      Returns:
      The value of the minimum upper bound element of the syntax definition for this attribute type, or -1 if no syntax is defined defined or if it does not have a valid minimum upper bound.
    • getSyntaxMinimumUpperBound

      public static int getSyntaxMinimumUpperBound(@Nullable String syntaxOID)
      Retrieves the value of the minimum upper bound element of the syntax definition for this attribute type, if defined. If a minimum upper bound is present (as signified by an integer value in curly braces immediately following the syntax OID without any space between them), then it should serve as an indication to the directory server that it should be prepared to handle values with at least that number of (possibly multi-byte) characters.
      Parameters:
      syntaxOID - The syntax OID (optionally including the minimum upper bound element) to examine.
      Returns:
      The value of the minimum upper bound element of the provided syntax OID, or -1 if the provided syntax OID is null or does not have a valid minimum upper bound.
    • isSingleValued

      public boolean isSingleValued()
      Indicates whether this attribute type is declared single-valued, and therefore attributes of this type will only be allowed to have at most one value.
      Returns:
      true if this attribute type is declared single-valued, or false if not.
    • isCollective

      public boolean isCollective()
      Indicates whether this attribute type is declared collective, and therefore values may be dynamically generated as described in RFC 3671.
      Returns:
      true if this attribute type is declared collective, or false if not.
    • isNoUserModification

      public boolean isNoUserModification()
      Indicates whether this attribute type is declared no-user-modification, and therefore attributes of this type will not be allowed to be altered by clients.
      Returns:
      true if this attribute type is declared no-user-modification, or false if not.
    • getUsage

      Retrieves the attribute usage for this attribute type.
      Returns:
      The attribute usage for this attribute type.
    • isOperational

      public boolean isOperational()
      Indicates whether this attribute type has an operational attribute usage.
      Returns:
      true if this attribute type has an operational attribute usage, or false if not.
    • getExtensions

      Retrieves the set of extensions for this attribute type. They will be mapped from the extension name (which should start with "X-") to the set of values for that extension.
      Returns:
      The set of extensions for this attribute type.
    • getSchemaElementType

      Retrieves the type of schema element that this object represents.
      Specified by:
      getSchemaElementType in class SchemaElement
      Returns:
      The type of schema element that this object represents.
    • hashCode

      public int hashCode()
      Retrieves a hash code for this schema element.
      Specified by:
      hashCode in class SchemaElement
      Returns:
      A hash code for this schema element.
    • equals

      public boolean equals(@Nullable Object o)
      Indicates whether the provided object is equal to this schema element.
      Specified by:
      equals in class SchemaElement
      Parameters:
      o - The object for which to make the determination.
      Returns:
      true if the provided object may be considered equal to this schema element, or false if not.
    • toString

      Retrieves a string representation of this attribute type definition, in the format described in RFC 4512 section 4.1.2.
      Specified by:
      toString in class SchemaElement
      Returns:
      A string representation of this attribute type definition.