net.shibboleth.metadata
Class DeduplicatingItemIdMergeStrategy
java.lang.Object
net.shibboleth.metadata.DeduplicatingItemIdMergeStrategy
- All Implemented Interfaces:
- CollectionMergeStrategy
public class DeduplicatingItemIdMergeStrategy
- extends Object
- implements CollectionMergeStrategy
A merge strategy that adds source items to the target collection if none of the Items in the target collection have
the same ItemId as source item. If the source item does not contain a ItemId it is always added to
the target collection.
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
DeduplicatingItemIdMergeStrategy
public DeduplicatingItemIdMergeStrategy()
mergeCollection
public void mergeCollection(@Nonnull@NonnullElements
Collection<Item<?>> target,
@Nonnull@NonnullElements
Collection<Item<?>>... sources)
- Merges the results of each child pipeline in to the collection of Item given to this stage.
- Specified by:
mergeCollection in interface CollectionMergeStrategy
- Parameters:
target - collection in to which all the Items should be merged, never nullsources - collections of Items to be merged in to the target, never null not containing any null elements
merge
private void merge(@Nonnull@NonnullElements
HashSet<ItemId> presentItemIds,
@Nonnull@NonnullElements
Collection<Item<?>> target,
@Nonnull@NonnullElements
Collection<Item<?>> sourceItems)
- Adds source items to the target collection if none of the Items in the target collection have the same
ItemId as source item. If the source item does not contain a ItemId it is always added to the
target collection.
- Parameters:
presentItemIds - IDs that are already present in the target collectiontarget - the collection to which items will be merged in tosourceItems - the collection of items to be merged in to the target
Copyright © 1999-2012. All Rights Reserved.