Package com.unboundid.ldap.sdk.schema
Class AttributeTypeDefinition
java.lang.Object
com.unboundid.ldap.sdk.schema.SchemaElement
com.unboundid.ldap.sdk.schema.AttributeTypeDefinition
- All Implemented Interfaces:
Serializable
@NotMutable
@ThreadSafety(level=COMPLETELY_THREADSAFE)
public final class AttributeTypeDefinition
extends SchemaElement
This class provides a data structure that describes an LDAP attribute type
schema element.
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionCreates a new attribute type from the provided string representation.AttributeTypeDefinition(String oid, String[] names, String description, boolean isObsolete, String superiorType, String equalityMatchingRule, String orderingMatchingRule, String substringMatchingRule, String syntaxOID, boolean isSingleValued, boolean isCollective, boolean isNoUserModification, AttributeUsage usage, Map<String, String[]> extensions) Creates a new attribute type with the provided information.AttributeTypeDefinition(String oid, String name, String description, String equalityMatchingRule, String orderingMatchingRule, String substringMatchingRule, String syntaxOID, boolean isSingleValued, Map<String, String[]> extensions) Creates a new attribute type with the provided information. -
Method Summary
Modifier and TypeMethodDescriptionbooleanIndicates whether the provided object is equal to this schema element.Retrieves the OID of the syntax for this attribute type, if available.getBaseSyntaxOID(Schema schema) Retrieves the base OID of the syntax for this attribute type, examining superior types if necessary.static StringgetBaseSyntaxOID(String syntaxOID) Retrieves the base OID of the syntax for this attribute type, examining superior types if necessary.Retrieves the description for this attribute type, if available.Retrieves the name or OID of the equality matching rule for this attribute type, if available.getEqualityMatchingRule(Schema schema) Retrieves the name or OID of the equality matching rule for this attribute type, examining superior attribute types if necessary.Retrieves the set of extensions for this attribute type.Retrieves the primary name that can be used to reference this attribute type.String[]getNames()Retrieves the set of names for this attribute type.getOID()Retrieves the OID for this attribute type.Retrieves the name or OID of the ordering matching rule for this attribute type, if available.getOrderingMatchingRule(Schema schema) Retrieves the name or OID of the ordering matching rule for this attribute type, examining superior attribute types if necessary.Retrieves the type of schema element that this object represents.Retrieves the name or OID of the substring matching rule for this attribute type, if available.getSubstringMatchingRule(Schema schema) Retrieves the name or OID of the substring matching rule for this attribute type, examining superior attribute types if necessary.Retrieves the name or OID of the superior type for this attribute type, if available.getSuperiorType(Schema schema) Retrieves the superior attribute type definition for this attribute type, if available.intRetrieves the value of the minimum upper bound element of the syntax definition for this attribute type, if defined.intgetSyntaxMinimumUpperBound(Schema schema) Retrieves the value of the minimum upper bound element of the syntax definition for this attribute type, if defined.static intgetSyntaxMinimumUpperBound(String syntaxOID) Retrieves the value of the minimum upper bound element of the syntax definition for this attribute type, if defined.Retrieves the OID of the syntax for this attribute type, if available.getSyntaxOID(Schema schema) Retrieves the OID of the syntax for this attribute type, examining superior types if necessary.getUsage()Retrieves the attribute usage for this attribute type.inthashCode()Retrieves a hash code for this schema element.booleanIndicates whether the provided string matches the OID or any of the names for this attribute type.booleanIndicates whether this attribute type is declared collective, and therefore values may be dynamically generated as described in RFC 3671.booleanIndicates whether this attribute type is declared no-user-modification, and therefore attributes of this type will not be allowed to be altered by clients.booleanIndicates whether this attribute type is declared obsolete.booleanIndicates whether this attribute type has an operational attribute usage.booleanIndicates whether this attribute type is declared single-valued, and therefore attributes of this type will only be allowed to have at most one value.toString()Retrieves a string representation of this attribute type definition, in the format described in RFC 4512 section 4.1.2.Methods inherited from class com.unboundid.ldap.sdk.schema.SchemaElement
allowEmptyDescription, extensionsEqual, setAllowEmptyDescription
-
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 benull.- 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 benull.name- The name for this attribute type. It may benullif the attribute type should only be referenced by OID.description- The description for this attribute type. It may benullif there is no description.equalityMatchingRule- The name or OID of the equality matching rule for this attribute type. It may benullif a default rule is to be inherited.orderingMatchingRule- The name or OID of the ordering matching rule for this attribute type. It may benullif a default rule is to be inherited.substringMatchingRule- The name or OID of the substring matching rule for this attribute type. It may benullif a default rule is to be inherited.syntaxOID- The syntax OID for this attribute type. It may benullif 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 benullor 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 benull.names- The set of names for this attribute type. It may benullor empty if the attribute type should only be referenced by OID.description- The description for this attribute type. It may benullif 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 benullif there is no superior type.equalityMatchingRule- The name or OID of the equality matching rule for this attribute type. It may benullif a default rule is to be inherited.orderingMatchingRule- The name or OID of the ordering matching rule for this attribute type. It may benullif a default rule is to be inherited.substringMatchingRule- The name or OID of the substring matching rule for this attribute type. It may benullif a default rule is to be inherited.syntaxOID- The syntax OID for this attribute type. It may benullif 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 benullif the default usage of userApplications is to be used.extensions- The set of extensions for this attribute type. It may benullor 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
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
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 benull.- Returns:
trueif the provided string matches the OID or any of the names for this attribute type, orfalseif not.
-
getDescription
Retrieves the description for this attribute type, if available.- Returns:
- The description for this attribute type, or
nullif there is no description defined.
-
isObsolete
Indicates whether this attribute type is declared obsolete.- Returns:
trueif this attribute type is declared obsolete, orfalseif 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
nullif 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
nullif 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
nullif 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
nullif 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
nullif 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
nullif 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
nullif 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
nullif 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
nullif 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
nullif 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
nullif 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
nullif no syntax is defined.
-
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:
syntaxOID- The syntax OID (optionally including the minimum upper bound element) to examine.- Returns:
- The OID of the syntax for this attribute type, or
nullif 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
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
nullor does not have a valid minimum upper bound.
-
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:
trueif this attribute type is declared single-valued, orfalseif not.
-
isCollective
Indicates whether this attribute type is declared collective, and therefore values may be dynamically generated as described in RFC 3671.- Returns:
trueif this attribute type is declared collective, orfalseif not.
-
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:
trueif this attribute type is declared no-user-modification, orfalseif not.
-
getUsage
Retrieves the attribute usage for this attribute type.- Returns:
- The attribute usage for this attribute type.
-
isOperational
Indicates whether this attribute type has an operational attribute usage.- Returns:
trueif this attribute type has an operational attribute usage, orfalseif 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:
getSchemaElementTypein classSchemaElement- Returns:
- The type of schema element that this object represents.
-
hashCode
Retrieves a hash code for this schema element.- Specified by:
hashCodein classSchemaElement- Returns:
- A hash code for this schema element.
-
equals
Indicates whether the provided object is equal to this schema element.- Specified by:
equalsin classSchemaElement- Parameters:
o- The object for which to make the determination.- Returns:
trueif the provided object may be considered equal to this schema element, orfalseif not.
-
toString
Retrieves a string representation of this attribute type definition, in the format described in RFC 4512 section 4.1.2.- Specified by:
toStringin classSchemaElement- Returns:
- A string representation of this attribute type definition.
-