Package net.shibboleth.metadata
Class DeduplicatingItemIdMergeStrategy
java.lang.Object
net.shibboleth.metadata.DeduplicatingItemIdMergeStrategy
- All Implemented Interfaces:
CollectionMergeStrategy
@ThreadSafe
public class DeduplicatingItemIdMergeStrategy
extends Object
implements CollectionMergeStrategy
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate <T> voidAdds source items to the target collection if none of the Items in the target collection have the sameItemIdas source item.<T> voidMerges the results of each child pipeline in to the collection of Item given to this stage.
-
Constructor Details
-
DeduplicatingItemIdMergeStrategy
public DeduplicatingItemIdMergeStrategy()
-
-
Method Details
-
merge
public <T> void merge(@Nonnull @NonnullElements List<Item<T>> target, @Nonnull @NonnullElements List<List<Item<T>>> sources) Description copied from interface:CollectionMergeStrategyMerges the results of each child pipeline in to the collection of Item given to this stage.- Specified by:
mergein interfaceCollectionMergeStrategy- Type Parameters:
T- type of data contained in the items- 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 <T> void merge(@Nonnull @NonnullElements HashSet<ItemId> presentItemIds, @Nonnull @NonnullElements List<Item<T>> target, @Nonnull @NonnullElements List<Item<T>> sourceItems) Adds source items to the target collection if none of the Items in the target collection have the sameItemIdas source item. If the source item does not contain aItemIdit is always added to the target collection.- Type Parameters:
T- type of data contained in the items- 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
-