public final class MultivaluedPersonAttributeUtils
extends java.lang.Object
| Modifier and Type | Method and Description |
|---|---|
static <K,V> void |
addResult(java.util.Map<K,java.util.List<V>> results,
K key,
java.lang.Object value)
Adds a key/value pair to the specified
Map, creating multi-valued
values when appropriate. |
static <T> java.util.Collection<T> |
flattenCollection(java.util.Collection<? extends java.lang.Object> source)
Takes a
Collection and creates a flattened Collection out
of it. |
static java.util.Map<java.lang.String,java.util.Set<java.lang.String>> |
parseAttributeToAttributeMapping(java.util.Map<java.lang.String,? extends java.lang.Object> mapping)
Translate from a more flexible Attribute to Attribute mapping format to a Map
from String to Set of Strings.
|
static java.util.Map<java.lang.String,java.util.List<java.lang.Object>> |
toMultivaluedMap(java.util.Map<java.lang.String,java.lang.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 java.util.Map<java.lang.String,java.util.Set<java.lang.String>> parseAttributeToAttributeMapping(java.util.Map<java.lang.String,? extends java.lang.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(java.util.Map<K,java.util.List<V>> results,
K key,
java.lang.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.java.lang.IllegalArgumentException - if any argument is nullpublic static <T> java.util.Collection<T> flattenCollection(java.util.Collection<? extends java.lang.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 java.util.Map<java.lang.String,java.util.List<java.lang.Object>> toMultivaluedMap(java.util.Map<java.lang.String,java.lang.Object> seed)
seed - Map of objectsCopyright © 2005-2018. All Rights Reserved.