Package org.forgerock.opendj.ldap.schema
Class AttributeType
java.lang.Object
org.forgerock.opendj.ldap.schema.AttributeType
- All Implemented Interfaces:
Comparable<AttributeType>,SchemaElement
This class defines a data structure for storing and interacting with an
attribute type, which contains information about the format of an attribute
and the syntax and matching rules that should be used when interacting with
it.
Where ordered sets of names, or extra properties are provided, the ordering
will be preserved when the associated fields are accessed via their getters
or via the Object.toString() methods.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final classA fluent API for incrementally constructing attribute type. -
Method Summary
Modifier and TypeMethodDescriptionintcompareTo(AttributeType type) Compares this attribute type to the provided attribute type.booleanReturnstrueif the provided object is an attribute type having the same numeric OID as this attribute type.Returns the matching rule that should be used for approximate matching with this attribute type.final StringReturns the description of this schema element, or the empty string if it does not have a description.Returns the matching rule that should be used for equality matching with this attribute type.Returns an unmodifiable map containing all of the extra properties associated with this schema element.Returns the name or OID for this schema definition.getNames()Returns an unmodifiable list containing the user-defined names that may be used to reference this schema definition.getOid()Returns the OID for this schema definition.Returns the matching rule that should be used for ordering with this attribute type.Returns the matching rule that should be used for substring matching with this attribute type.Returns the sub-types inheriting directly or indirectly from this attribute type.Returns the superior type for this attribute type.Returns the syntax for this attribute type.getUsage()Returns the usage indicator for this attribute type.inthashCode()Returns the hash code for this attribute type.booleanIndicates whether this schema definition has the specified name.booleanhasNameOrOid(String value) Indicates whether this schema definition has the specified name or OID.booleanReturns whether this attribute type has sub-types, inheriting directly or indirectly from this attribute type.booleanIndicates whether this attribute type is declared "collective".booleanIndicates whether this attribute type is declared "no-user-modification".booleanIndicates whether this attribute type is theobjectClassattribute type having the OID 2.5.4.0.booleanIndicates whether this schema definition is declared "obsolete".booleanIndicates whether this is an operational attribute.booleanIndicates whether this attribute type is a temporary place-holder allocated dynamically by a non-strict schema when no registered attribute type was found.booleanIndicates whether this attribute type is declared "single-value".booleanisSubTypeOf(AttributeType type) Indicates whether this attribute type is a sub-type of the provided attribute type.booleanisSuperTypeOf(AttributeType type) Indicates whether this attribute type is a super-type of the provided attribute type.booleanmatches(AttributeType type) Implements a place-holder tolerant version ofequals(java.lang.Object).Returns the option-less attribute description corresponding to this attribute type.final StringtoString()Returns the string representation of this schema element as defined in RFC 2252.
-
Method Details
-
compareTo
Compares this attribute type to the provided attribute type. The sort-order is defined as follows:- The
objectClassattribute is less than all other attribute types. - User attributes are less than operational attributes.
- Lexicographic comparison of the primary name and then, if equal, the OID.
- Specified by:
compareToin interfaceComparable<AttributeType>- Parameters:
type- The attribute type to be compared.- Returns:
- A negative integer, zero, or a positive integer as this attribute type is less than, equal to, or greater than the specified attribute type.
- Throws:
NullPointerException- Ifnamewasnull.
- The
-
equals
Returnstrueif the provided object is an attribute type having the same numeric OID as this attribute type.- Parameters:
o- The object to be compared.- Returns:
trueif the provided object is an attribute type having the same numeric OID as this attribute type.
-
getApproximateMatchingRule
Returns the matching rule that should be used for approximate matching with this attribute type.- Returns:
- The matching rule that should be used for approximate matching with this attribute type.
-
getSubTypes
Returns the sub-types inheriting directly or indirectly from this attribute type.- Returns:
- the sub-types inheriting directly or indirectly from this attribute type
-
hasSubTypes
public boolean hasSubTypes()Returns whether this attribute type has sub-types, inheriting directly or indirectly from this attribute type.- Returns:
trueif this attribute type has sub-types,falseotherwise
-
getEqualityMatchingRule
Returns the matching rule that should be used for equality matching with this attribute type.- Returns:
- The matching rule that should be used for equality matching with this attribute type.
-
getNameOrOid
Returns the name or OID for this schema definition. If it has one or more names, then the primary name will be returned. If it does not have any names, then the OID will be returned.- Returns:
- The name or OID for this schema definition.
-
getNames
Returns an unmodifiable list containing the user-defined names that may be used to reference this schema definition.- Returns:
- Returns an unmodifiable list containing the user-defined names that may be used to reference this schema definition.
-
getOid
Returns the OID for this schema definition.- Returns:
- The OID for this schema definition.
-
getOrderingMatchingRule
Returns the matching rule that should be used for ordering with this attribute type.- Returns:
- The matching rule that should be used for ordering with this attribute type.
-
getSubstringMatchingRule
Returns the matching rule that should be used for substring matching with this attribute type.- Returns:
- The matching rule that should be used for substring matching with this attribute type.
-
getSuperiorType
Returns the superior type for this attribute type.- Returns:
- The superior type for this attribute type, or
nullif it does not have one.
-
getSyntax
Returns the syntax for this attribute type.- Returns:
- The syntax for this attribute type.
-
getUsage
Returns the usage indicator for this attribute type.- Returns:
- The usage indicator for this attribute type.
-
hashCode
public int hashCode()Returns the hash code for this attribute type. It will be calculated as the hash code of the numeric OID.- Returns:
- The hash code for this attribute type.
-
hasName
Indicates whether this schema definition has the specified name.- Parameters:
name- The name for which to make the determination.- Returns:
trueif the specified name is assigned to this schema definition,falseotherwise.
-
hasNameOrOid
Indicates whether this schema definition has the specified name or OID.- Parameters:
value- The value for which to make the determination.- Returns:
trueif the provided value matches the OID or one of the names assigned to this schema definition,falseotherwise.
-
isCollective
public boolean isCollective()Indicates whether this attribute type is declared "collective".- Returns:
trueif this attribute type is declared "collective",falseotherwise.
-
isNoUserModification
public boolean isNoUserModification()Indicates whether this attribute type is declared "no-user-modification".- Returns:
trueif this attribute type is declared "no-user-modification",falseotherwise.
-
isObjectClass
public boolean isObjectClass()Indicates whether this attribute type is theobjectClassattribute type having the OID 2.5.4.0.- Returns:
trueif this attribute type is theobjectClassattribute type,falseotherwise.
-
isObsolete
public boolean isObsolete()Indicates whether this schema definition is declared "obsolete".- Returns:
trueif this schema definition is declared "obsolete",falseotherwise.
-
isOperational
public boolean isOperational()Indicates whether this is an operational attribute. An operational attribute is one with a usage of "directoryOperation", "distributedOperation", or "dSAOperation" (i.e., only userApplications is not operational).- Returns:
trueif this is an operational attribute,falseotherwise.
-
isPlaceHolder
public boolean isPlaceHolder()Indicates whether this attribute type is a temporary place-holder allocated dynamically by a non-strict schema when no registered attribute type was found.Place holder attribute types have an OID which is the normalized attribute name with the string
-oidappended. In addition, they will use the directory string syntax and case ignore matching rule.- Returns:
trueif this is a temporary place-holder attribute type allocated dynamically by a non-strict schema when no registered attribute type was found.- See Also:
-
isSingleValue
public boolean isSingleValue()Indicates whether this attribute type is declared "single-value".- Returns:
trueif this attribute type is declared "single-value",falseotherwise.
-
isSubTypeOf
Indicates whether this attribute type is a sub-type of the provided attribute type.- Parameters:
type- The attribute type for which to make the determination.- Returns:
trueif this attribute type is a sub-type of the provided attribute type,falseotherwise.- Throws:
NullPointerException- Iftypewasnull.
-
isSuperTypeOf
Indicates whether this attribute type is a super-type of the provided attribute type.- Parameters:
type- The attribute type for which to make the determination.- Returns:
trueif this attribute type is a super-type of the provided attribute type,falseotherwise.- Throws:
NullPointerException- Iftypewasnull.
-
matches
Implements a place-holder tolerant version ofequals(java.lang.Object). This method returnstruein the following cases:- this attribute type is equal to the provided attribute type as
specified by
equals(java.lang.Object) - this attribute type is a place-holder and the provided attribute type has a name which matches the name of this attribute type
- the provided attribute type is a place-holder and this attribute type has a name which matches the name of the provided attribute type.
- Parameters:
type- The attribute type for which to make the determination.- Returns:
trueif the provided attribute type matches this attribute type.
- this attribute type is equal to the provided attribute type as
specified by
-
toAttributeDescription
Returns the option-less attribute description corresponding to this attribute type.- Returns:
- the option-less attribute description corresponding to this attribute type
-
getDescription
Description copied from interface:SchemaElementReturns the description of this schema element, or the empty string if it does not have a description.- Specified by:
getDescriptionin interfaceSchemaElement- Returns:
- The description of this schema element, or the empty string if it does not have a description.
-
getExtraProperties
Description copied from interface:SchemaElementReturns an unmodifiable map containing all of the extra properties associated with this schema element.- Specified by:
getExtraPropertiesin interfaceSchemaElement- Returns:
- An unmodifiable map containing all of the extra properties associated with this schema element.
-
toString
Returns the string representation of this schema element as defined in RFC 2252.
-