public abstract class AbstractAttribute extends AbstractSet<ByteString> implements Attribute
Attribute
interface, to minimize the effort required to
implement this interface.Modifier | Constructor and Description |
---|---|
protected |
AbstractAttribute()
Sole constructor.
|
Modifier and Type | Method and Description |
---|---|
boolean |
add(Object... values)
Adds all of the provided attribute values to this attribute if they are
not already present (optional operation).
|
boolean |
addAll(Collection<? extends ByteString> values)
Adds all of the attribute values contained in
values to this
attribute if they are not already present (optional operation). |
<T> boolean |
addAll(Collection<T> values,
Collection<? super T> duplicateValues)
Adds all of the attribute values contained in
values to this
attribute if they are not already present (optional operation). |
boolean |
contains(Object obj)
Returns
true if this attribute contains value . |
boolean |
containsAll(Collection<?> values)
Returns
true if this attribute contains all of the attribute values contained in values . |
boolean |
equals(Object object)
Returns
true if object is an attribute which is equal to
this attribute. |
ByteString |
firstValue()
Returns the first attribute value in this attribute.
|
int |
hashCode()
Returns the hash code for this attribute.
|
boolean |
isEmpty()
Returns
true if this attribute contains no attribute values. |
abstract Iterator<ByteString> |
iterator()
Returns an iterator over the attribute values in this attribute.
|
ConditionResult |
matchesApproximateAssertion(Assertion assertion,
ByteSequence rawAssertion)
Indicates whether this attribute matches the specified assertion using the attribute's default approximate
matching rule.
|
ConditionResult |
matchesEqualityAssertion(Assertion assertion,
ByteSequence rawAssertion)
Indicates whether this attribute matches the specified assertion using the attribute's default equality matching
rule.
|
ConditionResult |
matchesGreaterOrEqualAssertion(Assertion assertion,
ByteSequence rawAssertion)
Indicates whether this attribute matches the specified assertion using the attribute's default ordering matching
rule.
|
ConditionResult |
matchesLessOrEqualAssertion(Assertion assertion,
ByteSequence rawAssertion)
Indicates whether this attribute matches the specified assertion using the attribute's default ordering matching
rule.
|
ConditionResult |
matchesSubstringAssertion(Assertion assertion,
ByteSequence rawInitialSubstring,
List<? extends ByteSequence> rawAnySubstrings,
ByteSequence rawFinalSubstring)
Indicates whether this attribute matches the specified assertion using the attribute's default ordering matching
rule.
|
AttributeParser |
parse()
Returns a parser for this attribute which can be used for decoding values as different types of object.
|
boolean |
removeAll(Collection<?> values)
Removes all of the attribute values contained in
values from this
attribute if they are present (optional operation). |
<T> boolean |
removeAll(Collection<T> values,
Collection<? super T> missingValues)
Removes all of the attribute values contained in
values from this
attribute if they are present (optional operation). |
boolean |
retainAll(Collection<?> values)
Retains only the attribute values in this attribute which are contained in
values (optional operation). |
<T> boolean |
retainAll(Collection<T> values,
Collection<? super T> missingValues)
Retains only the attribute values in this attribute which are contained
in
values (optional operation). |
int |
size()
Returns the number of attribute values in this attribute.
|
ByteString[] |
toArray()
Returns an array containing all of the attribute values contained in this
attribute.
|
String |
toString()
Returns a string representation of this attribute.
|
add, clear, remove, toArray
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
add, clear, firstValueAsString, getAttributeDescription, getAttributeDescriptionAsString, isReal, isVirtual, remove, toArray
parallelStream, removeIf, spliterator, stream
public boolean add(Object... values)
Attribute
Any attribute values which are not instances of ByteString
will
be converted using the ByteString.valueOfObject(Object)
method.
public boolean addAll(Collection<? extends ByteString> values)
Attribute
values
to this
attribute if they are not already present (optional operation).
An invocation of this method is equivalent to:
attribute.addAll(values, null);
addAll
in interface Collection<ByteString>
addAll
in interface Set<ByteString>
addAll
in interface Attribute
addAll
in class AbstractCollection<ByteString>
values
- The attribute values to be added to this attribute.true
if this attribute changed as a result of this call.public <T> boolean addAll(Collection<T> values, Collection<? super T> duplicateValues)
Attribute
values
to this
attribute if they are not already present (optional operation). Any
attribute values which are already present will be added to
duplicateValues
if specified.
Any attribute values which are not instances of ByteString
will
be converted using the ByteString.valueOfObject(Object)
method.
addAll
in interface Attribute
T
- The type of the attribute value objects being added.values
- The attribute values to be added to this attribute.duplicateValues
- A collection into which duplicate values will be added,
or null
if duplicate values should not be saved.true
if this attribute changed as a result of this call.public boolean contains(Object obj)
Attribute
true
if this attribute contains value
.
If value
is not an instance of ByteString
then it will be
converted using the ByteString.valueOfObject(Object)
method.
contains
in interface Collection<ByteString>
contains
in interface Set<ByteString>
contains
in interface Attribute
contains
in class AbstractCollection<ByteString>
obj
- The attribute value whose presence in this attribute is to be tested.true
if this attribute contains value
, or false
if not.public boolean containsAll(Collection<?> values)
Attribute
true
if this attribute contains all of the attribute values contained in values
.
Any attribute values which are not instances of ByteString
will
be converted using the ByteString.valueOfObject(Object)
method.
containsAll
in interface Collection<ByteString>
containsAll
in interface Set<ByteString>
containsAll
in interface Attribute
containsAll
in class AbstractCollection<ByteString>
values
- The attribute values whose presence in this attribute is to be tested.true
if this attribute contains all of the attribute values contained in values
,
or false
if not.public boolean equals(Object object)
Attribute
true
if object
is an attribute which is equal to
this attribute. Two attributes are considered equal if their attribute
descriptions are equal, they both have the same number of attribute
values, and every attribute value contained in the first attribute is
also contained in the second attribute.equals
in interface Collection<ByteString>
equals
in interface Set<ByteString>
equals
in interface Attribute
equals
in class AbstractSet<ByteString>
object
- The object to be tested for equality with this attribute.true
if object
is an attribute which is equal to this attribute, or false
if not.public ByteString firstValue()
Attribute
firstValue
in interface Attribute
public int hashCode()
Attribute
hashCode
in interface Collection<ByteString>
hashCode
in interface Set<ByteString>
hashCode
in interface Attribute
hashCode
in class AbstractSet<ByteString>
public AttributeParser parse()
Attribute
public abstract Iterator<ByteString> iterator()
Attribute
iterator
in interface Iterable<ByteString>
iterator
in interface Collection<ByteString>
iterator
in interface Set<ByteString>
iterator
in interface Attribute
iterator
in class AbstractCollection<ByteString>
public ConditionResult matchesApproximateAssertion(Assertion assertion, ByteSequence rawAssertion)
Attribute
matchesApproximateAssertion
in interface Attribute
assertion
- The attribute value assertion compiled using the attribute's default approximate matching rule.rawAssertion
- The raw assertion value whose syntax is compatible with the attribute's default approximate
matching rule.ConditionResult.FALSE
if the assertion does not match any values in this attribute,
ConditionResult.TRUE
if the assertion matches at least one value in this attribute,
or ConditionResult.UNDEFINED
if the assertion does not match any values in this attribute,
but one or more values could not be compared because they are incompatible with the matching rule.public ConditionResult matchesEqualityAssertion(Assertion assertion, ByteSequence rawAssertion)
Attribute
matchesEqualityAssertion
in interface Attribute
assertion
- The attribute value assertion compiled using the attribute's default equality matching rule.rawAssertion
- The raw assertion value whose syntax is compatible with the attribute's default equality matching rule.ConditionResult.FALSE
if the assertion does not match any values in this attribute,
ConditionResult.TRUE
if the assertion matches at least one value in this attribute,
or ConditionResult.UNDEFINED
if the assertion does not match any values in this attribute,
but one or more values could not be compared because they are incompatible with the matching rule.public ConditionResult matchesGreaterOrEqualAssertion(Assertion assertion, ByteSequence rawAssertion)
Attribute
matchesGreaterOrEqualAssertion
in interface Attribute
assertion
- The attribute value assertion compiled using the attribute's default ordering matching rule.rawAssertion
- The raw assertion value whose syntax is compatible with the attribute's default ordering matching rule.ConditionResult.FALSE
if the assertion does not match any values in this attribute,
ConditionResult.TRUE
if the assertion matches at least one value in this attribute,
or ConditionResult.UNDEFINED
if the assertion does not match any values in this attribute,
but one or more values could not be compared because they are incompatible with the matching rule.public ConditionResult matchesLessOrEqualAssertion(Assertion assertion, ByteSequence rawAssertion)
Attribute
matchesLessOrEqualAssertion
in interface Attribute
assertion
- The attribute value assertion compiled using the attribute's default ordering matching rule.rawAssertion
- The raw assertion value whose syntax is compatible with the attribute's default ordering matching rule.ConditionResult.FALSE
if the assertion does not match any values in this attribute,
ConditionResult.TRUE
if the assertion matches at least one value in this attribute,
or ConditionResult.UNDEFINED
if the assertion does not match any values in this attribute,
but one or more values could not be compared because they are incompatible with the matching rule.public ConditionResult matchesSubstringAssertion(Assertion assertion, ByteSequence rawInitialSubstring, List<? extends ByteSequence> rawAnySubstrings, ByteSequence rawFinalSubstring)
Attribute
matchesSubstringAssertion
in interface Attribute
assertion
- The attribute value assertion compiled using the attribute's default ordering matching rule.rawInitialSubstring
- The assertion's initial sub-string, may be null
if either rawFinalSubstring
or rawAnySubstrings
are specified.rawAnySubstrings
- The assertion's intermediate sub-strings, may be empty if either rawFinalSubstring
or rawAnySubstrings
are specified.rawFinalSubstring
- The final sub-string, may be null
if either rawInitialSubstring
or
rawAnySubstrings
are specified.ConditionResult.FALSE
if the assertion does not match any values in this attribute,
ConditionResult.TRUE
if the assertion matches at least one value in this attribute,
or ConditionResult.UNDEFINED
if the assertion does not match any values in this attribute,
but one or more values could not be compared because they are incompatible with the matching rule.public boolean removeAll(Collection<?> values)
Attribute
values
from this
attribute if they are present (optional operation).
Any attribute values which are not instances of ByteString
will
be converted using the ByteString.valueOfObject(Object)
method.
An invocation of this method is equivalent to:
attribute.removeAll(values, null);
removeAll
in interface Collection<ByteString>
removeAll
in interface Set<ByteString>
removeAll
in interface Attribute
removeAll
in class AbstractSet<ByteString>
values
- The attribute values to be removed from this attribute.true
if this attribute changed as a result of this call.public <T> boolean removeAll(Collection<T> values, Collection<? super T> missingValues)
Attribute
values
from this
attribute if they are present (optional operation). Any attribute values
which are not already present will be added to missingValues
if specified.
Any attribute values which are not instances of ByteString
will
be converted using the ByteString.valueOfObject(Object)
method.
removeAll
in interface Attribute
T
- The type of the attribute value objects being removed.values
- The attribute values to be removed from this attribute.missingValues
- A collection into which missing values will be added,
or null
if missing values should not be saved.true
if this attribute changed as a result of this call.public boolean retainAll(Collection<?> values)
Attribute
values
(optional operation).
Any attribute values which are not instances of ByteString
will
be converted using the ByteString.valueOfObject(Object)
method.
An invocation of this method is equivalent to:
attribute.retainAll(values, null);
retainAll
in interface Collection<ByteString>
retainAll
in interface Set<ByteString>
retainAll
in interface Attribute
retainAll
in class AbstractCollection<ByteString>
values
- The attribute values to be retained in this attribute.true
if this attribute changed as a result of this call.public <T> boolean retainAll(Collection<T> values, Collection<? super T> missingValues)
Attribute
values
(optional operation). Any attribute values which are
not already present will be added to missingValues
if specified.
Any attribute values which are not instances of ByteString
will
be converted using the ByteString.valueOfObject(Object)
method.
retainAll
in interface Attribute
T
- The type of the attribute value objects being retained.values
- The attribute values to be retained in this attribute.missingValues
- A collection into which missing values will be added,
or null
if missing values should not be saved.true
if this attribute changed as a result of this call.public boolean isEmpty()
Attribute
true
if this attribute contains no attribute values.isEmpty
in interface Collection<ByteString>
isEmpty
in interface Set<ByteString>
isEmpty
in interface Attribute
isEmpty
in class AbstractCollection<ByteString>
true
if this attribute contains no attribute values.public int size()
Attribute
size
in interface Collection<ByteString>
size
in interface Set<ByteString>
size
in interface Attribute
size
in class AbstractCollection<ByteString>
public ByteString[] toArray()
Attribute
If this attribute makes any guarantees as to what order its attribute values are returned by its iterator, this method must return the attribute values in the same order.
The returned array will be "safe" in that no references to it are maintained by this attribute. The caller is thus free to modify the returned array.
toArray
in interface Collection<ByteString>
toArray
in interface Set<ByteString>
toArray
in interface Attribute
toArray
in class AbstractCollection<ByteString>
public String toString()
Attribute
toString
in interface Attribute
toString
in class AbstractCollection<ByteString>
Copyright 2010-2022 ForgeRock AS.