| java.lang.Object org.jasig.portal.services.persondir.support.MultivaluedPersonAttributeUtils
MultivaluedPersonAttributeUtils | final public class MultivaluedPersonAttributeUtils (Code) | | author: Eric Dalquist edalquist@unicon.net version: $Revision: 42241 $ $Date: 2007-07-25 10:55:01 -0700 (Wed, 25 Jul 2007) $ since: uPortal 2.5 |
Method Summary | |
public static void | addResult(Map results, Object key, Object value) Adds a key/value pair to the specified
Map , creating multi-valued
values when appropriate. | public static Collection | flattenCollection(Collection source) Takes a
Collection and creates a flattened
Collection out
of it.
Parameters: source - The Collection to flatten. | public static Map | parseAttributeToAttributeMapping(Map mapping) Translate from a more flexible Attribute to Attribute mapping format to a Map
from String to Set of Strings.
The point of the map is to map from attribute names in the underlying data store
(e.g., JDBC column names, LDAP attribute names) to uPortal attribute names. |
addResult | public static void addResult(Map results, Object key, Object value)(Code) | | Adds a key/value pair to the specified
Map , creating multi-valued
values when appropriate.
Since multi-valued attributes end up with a value of type
List , passing in a
List of any type will
cause its contents to be added to the results
Map directly under the specified key
Parameters: results - The Map to modify. Parameters: key - The key to add the value for. Parameters: value - The value to add for the key. throws: IllegalArgumentException - if any argument is null |
parseAttributeToAttributeMapping | public static Map parseAttributeToAttributeMapping(Map mapping)(Code) | | Translate from a more flexible Attribute to Attribute mapping format to a Map
from String to Set of Strings.
The point of the map is to map from attribute names in the underlying data store
(e.g., JDBC column names, LDAP attribute names) to uPortal attribute names.
Any given underlying data store attribute might map to zero uPortal
attributes (not appear in the map at all), map to exactly one uPortal attribute
(appear in the Map as a mapping from a String to a String or as a mapping
from a String to a Set containing just one String), or map to several uPortal
attribute names (appear in the Map as a mapping from a String to a Set
of Strings).
This method takes as its argument a
Map that must have keys of
type
String and values of type
String or
Set of
String s. The argument must not be null and must have no null
keys or null values. It must contain no keys other than Strings and no
values other than Strings or Sets of Strings. This method will throw
IllegalArgumentException if the method argument doesn't meet these
requirements.
This method returns a Map equivalent to its argument except whereever there
was a String value in the Map there will instead be an immutable Set containing
the String value. That is, the return value is normalized to be a Map from
String to Set (of String).
Parameters: mapping - Map from String names of attributes in the underlying store to uP attribute names or Sets of such names. a Map from String to Set of Strings throws: IllegalArgumentException - If the Map doesn't follow the rules stated above. |
|
|