Package com.isode.dsapi
Class Selection
java.lang.Object
com.isode.dsapi.Selection
- All Implemented Interfaces:
- Iterable<AttributeType>
Representation of an attribute selection (used in directory
 searches and reads).  A selection may specify:
 
- no attributes at all
- a set of "named" attribute types
- a flag to indicate all user attributes
- a flag to indicate all operational attributes
selectAttributeType(AttributeType), followed by a call either to
 selectAllOperational() or selectAllUser().
 The class will not allow the creation of Selection objects that contain a set of "named" attribute types and "all user attributes" and "all operational attributes". Such a selection is specifically disallowed by X.511-205 (7.6).
- 
Nested Class SummaryNested ClassesModifier and TypeClassDescriptionstatic enumConvenience enums to be used when creating a Selection object.
- 
Constructor SummaryConstructorsConstructorDescriptionConstruct a new Selection object which will specifyALL_USER_ATTRIBUTES.Construct a new Selection object.
- 
Method SummaryModifier and TypeMethodDescriptionbooleanisEmpty()Determine whether this represents an empty selection.booleanDetermine whether this Selection specifies "all operational attributes"booleanDetermine whether this Selection specifies "all user attributes"iterator()For a Selection which names a set of attribute types, return an iterator over the AttributeTypes held by this Selection, or otherwise return an iterator over an empty list.voidSet the flag which specifies all operational attributes.voidSet the flag which specifies all user attributes.voidSelect all user and operational attributes.voidselectAttributeType(AttributeType attrType) Add an attribute to the Selection.voidSet the object to specify no attributes at all (this clears any settings for all user attributes or all operational attributes).toString()Returns String representation of this Selection, useful for debugging.Methods inherited from class java.lang.Objectclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface java.lang.IterableforEach, spliterator
- 
Constructor Details- 
SelectionConstruct a new Selection object.- Parameters:
- type- one of the values- NO_ATTRIBUTES,- ALL_USER_ATTRIBUTES,- ALL_OPER_ATTRIBUTES,- ALL_USER_AND_OPER_ATTRIBUTES
- Throws:
- IllegalArgumentException- if type is not one of the values listed above.
 
- 
Selectionpublic Selection()Construct a new Selection object which will specifyALL_USER_ATTRIBUTES.
 
- 
- 
Method Details- 
selectAttributeTypeAdd an attribute to the Selection. If the selected attribute was already in the selection, then this method does not change the Selection.If the Selection currently specifies all operational attributes or all user attributes, those flags will be cleared. - Parameters:
- attrType- an AttributeType
- Throws:
- NullPointerException- if attrType is null.
 
- 
selectAllUserpublic void selectAllUser()Set the flag which specifies all user attributes. This operation clears the "all operational attributes" flag.
- 
selectAllOperationalpublic void selectAllOperational()Set the flag which specifies all operational attributes. This operation clears the "all user attributes" flag.
- 
selectAllUserAndOperpublic void selectAllUserAndOper()Select all user and operational attributes. If the Selection contains any named attributes, they will be removed from the selection.
- 
selectNoAttributespublic void selectNoAttributes()Set the object to specify no attributes at all (this clears any settings for all user attributes or all operational attributes).
- 
toStringReturns String representation of this Selection, useful for debugging.
- 
isEmptypublic boolean isEmpty()Determine whether this represents an empty selection. An empty selection does not specify "all operational attributes" or "all user attributes" or any named attributes.- Returns:
- true if this is an empty selection.
 
- 
iteratorFor a Selection which names a set of attribute types, return an iterator over the AttributeTypes held by this Selection, or otherwise return an iterator over an empty list.- Specified by:
- iteratorin interface- Iterable<AttributeType>
- Returns:
- an iterator which returns all the AttributeTypes in this Selection
 
- 
isSelectingAllUserpublic boolean isSelectingAllUser()Determine whether this Selection specifies "all user attributes"- Returns:
- true if "all user attributes" are specified, false otherwise.
 
- 
isSelectingAllOperpublic boolean isSelectingAllOper()Determine whether this Selection specifies "all operational attributes"- Returns:
- true if "all operational attributes" are specified, false otherwise.
 
 
-