public final class AttributeDescription extends Object implements Comparable<AttributeDescription>
Modifier and Type | Method and Description |
---|---|
int |
compareTo(AttributeDescription other)
Compares this attribute description to the provided attribute
description.
|
static AttributeDescription |
create(AttributeType attributeType)
Creates an attribute description having the provided attribute type and no options.
|
static AttributeDescription |
create(AttributeType attributeType,
Collection<String> options)
Creates an attribute description having the provided attribute type and options.
|
static AttributeDescription |
create(AttributeType attributeType,
String... options)
Creates an attribute description having the provided attribute type and options.
|
static AttributeDescription |
create(AttributeType attributeType,
String option)
Creates an attribute description having the provided attribute type and single option.
|
static AttributeDescription |
create(String attributeName,
AttributeType attributeType)
Deprecated.
This method may be removed at any time
|
static AttributeDescription |
create(String attributeName,
AttributeType attributeType,
Collection<String> options)
Deprecated.
This method may be removed at any time
|
static AttributeDescription |
create(String attributeName,
AttributeType attributeType,
String... options)
Deprecated.
This method may be removed at any time
|
static AttributeDescription |
create(String attributeName,
AttributeType attributeType,
String option)
Deprecated.
This method may be removed at any time
|
boolean |
equals(Object o)
Indicates whether the provided object is an attribute description which
is equal to this attribute description.
|
AttributeType |
getAttributeType()
Returns the attribute type associated with this attribute description.
|
String |
getNameOrOID()
Deprecated.
This method may be removed at any time
|
Iterable<String> |
getOptions()
Returns an
Iterable containing the options contained in this
attribute description. |
int |
hashCode()
Returns the hash code for this attribute description.
|
boolean |
hasOption(String option)
Indicates whether this attribute description contains the provided option.
|
boolean |
hasOptions()
Indicates whether this attribute description has any options.
|
boolean |
isObjectClass()
Indicates whether this attribute description is the
objectClass attribute description with no options. |
boolean |
isPlaceHolder()
Indicates whether this attribute description is a temporary place-holder
allocated dynamically by a non-strict schema when no corresponding
registered attribute type was found.
|
boolean |
isSubTypeOf(AttributeDescription other)
Indicates whether this attribute description is a sub-type of the
provided attribute description as defined in RFC 4512 section 2.5.
|
boolean |
isSuperTypeOf(AttributeDescription other)
Indicates whether this attribute description is a super-type of
the provided attribute description as defined in RFC 4512 section 2.5.
|
boolean |
matches(AttributeDescription other)
Indicates whether the provided attribute description matches this
attribute description.
|
static AttributeDescription |
objectClass()
Returns an attribute description representing the object class attribute
type with no options.
|
String |
toString()
Returns the string representation of this attribute description as
defined in RFC4512 section 2.5.
|
static AttributeDescription |
valueOf(String attributeDescription)
Parses the provided LDAP string representation of an attribute
description using the default schema.
|
static AttributeDescription |
valueOf(String attributeDescription,
Schema schema)
Parses the provided LDAP string representation of an attribute
description using the provided schema.
|
AttributeDescription |
withOption(String option)
Returns an attribute description having the same attribute type and
options as this attribute description as well as the provided option.
|
AttributeDescription |
withoutOption(String option)
Returns an attribute description having the same attribute type and
options as this attribute description except for the provided option.
|
public AttributeDescription withOption(String option)
option
- The attribute option.option
.NullPointerException
- If attributeDescription
or option
was
null
.public AttributeDescription withoutOption(String option)
This method is idempotent: if this attribute description does not contain the provided option then this attribute description will be returned.
option
- The attribute option.option
.NullPointerException
- If attributeDescription
or option
was
null
.public static AttributeDescription create(AttributeType attributeType)
attributeType
- The attribute type.NullPointerException
- If attributeType
was null
.@Deprecated public static AttributeDescription create(String attributeName, AttributeType attributeType)
attributeName
- The attribute name.attributeType
- The attribute type.NullPointerException
- If attributeType
was null
.public static AttributeDescription create(AttributeType attributeType, String option)
attributeType
- The attribute type.option
- The attribute option.NullPointerException
- If attributeType
or option
was null
.@Deprecated public static AttributeDescription create(String attributeName, AttributeType attributeType, String option)
attributeName
- The attribute name.attributeType
- The attribute type.option
- The attribute option.NullPointerException
- If attributeType
or option
was null
.@Deprecated public static AttributeDescription create(String attributeName, AttributeType attributeType, String... options)
attributeName
- The attribute name.attributeType
- The attribute type.options
- The attribute options.NullPointerException
- If attributeType
or options
was null
.public static AttributeDescription create(AttributeType attributeType, String... options)
attributeType
- The attribute type.options
- The attribute options.NullPointerException
- If attributeType
or options
was null
.public static AttributeDescription create(AttributeType attributeType, Collection<String> options)
attributeType
- The attribute type.options
- The attribute options.NullPointerException
- If attributeType
or options
was null
.@Deprecated public static AttributeDescription create(String attributeName, AttributeType attributeType, Collection<String> options)
attributeName
- The attribute name.attributeType
- The attribute type.options
- The attribute options.NullPointerException
- If attributeType
or options
was null
.public static AttributeDescription objectClass()
public static AttributeDescription valueOf(String attributeDescription)
attributeDescription
- The LDAP string representation of an attribute description.UnknownSchemaElementException
- If attributeDescription
contains an attribute type
which is not contained in the default schema and the schema
is strict.LocalizedIllegalArgumentException
- If attributeDescription
is not a valid LDAP string
representation of an attribute description.NullPointerException
- If attributeDescription
was null
.public static AttributeDescription valueOf(String attributeDescription, Schema schema)
attributeDescription
- The LDAP string representation of an attribute description.schema
- The schema to use when parsing the attribute description.UnknownSchemaElementException
- If attributeDescription
contains an attribute type
which is not contained in the provided schema and the schema
is strict.LocalizedIllegalArgumentException
- If attributeDescription
is not a valid LDAP string
representation of an attribute description.NullPointerException
- If attributeDescription
or schema
was
null
.public int compareTo(AttributeDescription other)
compareTo
in interface Comparable<AttributeDescription>
other
- The attribute description to be compared.NullPointerException
- If name
was null
.public boolean hasOption(String option)
option
- The option for which to make the determination.true
if this attribute description has the provided
option, or false
if not.NullPointerException
- If option
was null
.public boolean equals(Object o)
equal
and normalized
sorted list of options are identical.public AttributeType getAttributeType()
@Deprecated public String getNameOrOID()
In other words, it returns the user-provided name or oid of this attribute description, leaving out the option(s).
public Iterable<String> getOptions()
Iterable
containing the options contained in this
attribute description. Attempts to remove options using an iterator's
remove()
method are not permitted and will result in an
UnsupportedOperationException
being thrown.Iterable
containing the options.public int hashCode()
public boolean hasOptions()
true
if this attribute description has any options, or
false
if not.public boolean isObjectClass()
objectClass
attribute description with no options.true
if this attribute description is the
objectClass
attribute description with no options, or
false
if not.public boolean isPlaceHolder()
Place holder attribute descriptions have an attribute type whose OID is
the normalized attribute name with the string -oid
appended. In
addition, they will use the directory string syntax and case ignore
matching rule.
true
if this is a temporary place-holder attribute
description allocated dynamically by a non-strict schema when no
corresponding registered attribute type was found.Schema.getAttributeType(String)
,
AttributeType.isPlaceHolder()
public boolean isSubTypeOf(AttributeDescription other)
true
if and only if the
following conditions are both true
:
matches
, or is a sub-type of, the attribute
type in the provided attribute description.
true
if this attribute
description is equal to the provided attribute description.other
- The attribute description for which to make the determination.true
if this attribute description is a sub-type of the
provided attribute description, or false
if not.NullPointerException
- If name
was null
.public boolean isSuperTypeOf(AttributeDescription other)
true
if and only if the
following conditions are both true
:
matches
, or is a super-type of, the
attribute type in the provided attribute description.
true
if this attribute
description is equal to the provided attribute description.other
- The attribute description for which to make the determination.true
if this attribute description is a super-type of the
provided attribute description, or false
if not.NullPointerException
- If name
was null
.public boolean matches(AttributeDescription other)
match
and the normalized sorted list
of options are identical.other
- The attribute description for which to make the determination.true
if the provided attribute description matches this
attribute description, or false
if not.Copyright 2010-2017 ForgeRock AS.