public final class MultivaluedPersonAttributeUtils extends Object
| Modifier and Type | Method and Description |
|---|---|
static <K,V> void |
addResult(Map<K,List<V>> results,
K key,
Object value)
Adds a key/value pair to the specified
Map, creating multi-valued
values when appropriate. |
static <T> Collection<T> |
flattenCollection(Collection<? extends Object> source)
Takes a
Collection and creates a flattened Collection out
of it. |
static Map<String,Set<String>> |
parseAttributeToAttributeMapping(Map<String,? extends Object> mapping)
Translate from a more flexible Attribute to Attribute mapping format to a Map
from String to Set of Strings.
|
static Map<String,List<Object>> |
toMultivaluedMap(Map<String,Object> seed)
Convert the <String, Object> map to a <String, List<Object>> map by simply wrapping
each value in a singleton (read-only) List
|
public static Map<String,Set<String>> parseAttributeToAttributeMapping(Map<String,? extends Object> mapping)
Map that must have keys of
type String and values of type String or Set of
Strings. The argument must not be null and must have no null
keys. It must contain no keys other than Strings and no values other
than Strings or Sets of Strings. This method will convert any non-string
values to a String using the object's toString() method.
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).mapping - Map from String names of attributes in the underlying store
to uP attribute names or Sets of such names.public static <K,V> void addResult(Map<K,List<V>> results, K key, Object value)
Map, creating multi-valued
values when appropriate.
List, passing in a List of any type will
cause its contents to be added to the results
Map directly under the specified keyK - Key type (extends Object)V - Value type (extends Object)results - The Map to modify.key - The key to add the value for.value - The value to add for the key.IllegalArgumentException - if any argument is nullpublic static <T> Collection<T> flattenCollection(Collection<? extends Object> source)
Collection and creates a flattened Collection out
of it.T - Type of collection (extends Object)source - The Collection to flatten.Collection that contains all entries from all levels of source.public static Map<String,List<Object>> toMultivaluedMap(Map<String,Object> seed)
seed - Map of objectsCopyright © 2015 Jasig. All Rights Reserved.