org.jasig.portal.services.persondir.support.merger
Class NoncollidingAttributeAdder

java.lang.Object
  extended by org.jasig.portal.services.persondir.support.merger.NoncollidingAttributeAdder
All Implemented Interfaces:
IAttributeMerger

public class NoncollidingAttributeAdder
extends java.lang.Object
implements IAttributeMerger

Merger which implements accumulation of Map entries such that entries once established are individually immutable.

Version:
$Revision: 1.2 $ $Date: 2004/12/13 23:27:39 $
Author:
andrew.petro@yale.edu

Constructor Summary
NoncollidingAttributeAdder()
           
 
Method Summary
 java.util.Map mergeAttributes(java.util.Map toModify, java.util.Map toConsider)
          For entries in toConsider the keys of which are not keys in toModify, adds the entry to toModify and returns toModify.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

NoncollidingAttributeAdder

public NoncollidingAttributeAdder()
Method Detail

mergeAttributes

public java.util.Map mergeAttributes(java.util.Map toModify,
                                     java.util.Map toConsider)
For entries in toConsider the keys of which are not keys in toModify, adds the entry to toModify and returns toModify.

Specified by:
mergeAttributes in interface IAttributeMerger
Parameters:
toModify - - base Map the entries of which are considered here to be immutable.
toConsider - - Map to merge into toModify for all noncolliding keys.
Returns:
toModify with entries the intersection of our method arguments, with preference given to toModify's existing entries for all key collisions.