|
Groovy Documentation | |||||||
FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.linkedin.util.collections.CollectionsUtils
org.linkedin.groovy.util.collections.GroovyCollectionsUtils
class GroovyCollectionsUtils extends CollectionsUtils
Method Summary | |
---|---|
static java.util.Map
|
collectKey(java.util.Map srcMap, java.util.Map destMap, groovy.lang.Closure closure)
Iterate over every element in source map and store the result of |
static boolean
|
compareContent(java.util.Collection c1, java.util.Collection c2)
More generic call which compares the content of 2 collections: it will only compare the content |
static boolean
|
compareIgnoreType(java.util.Map map1, java.util.Map map2)
The main issue when comparing 2 maps is that if the type of the map is different then the 2 maps are different even if their content is the same... this method simply compares the content of the maps. |
static boolean
|
compareIgnoreType(java.util.List list1, java.util.List list2)
The main issue when comparing 2 lists is that if the type of the list is different then the 2 lists are different even if their content is the same... this method simply compares the content of the lists |
static boolean
|
compareIgnoreType(java.util.Set set1, java.util.Set set2)
The main issue when comparing 2 sets is that if the type of the list is different then the 2 sets are different even if their content is the same... this method simply compares the content of the sets |
static boolean
|
compareIgnoreType(java.util.Collection c1, java.util.Collection c2)
The main issue when comparing 2 collections is that if the type of the collection is different then the 2 collections are different even if their content is the same... this method simply compares the content of the collections |
static boolean
|
compareIgnoreType(java.lang.Object o1, java.lang.Object o2)
This method is being used for recursivity purposes |
static java.util.Map
|
flatten(java.util.Map map)
Flattens the map. |
static java.util.Map
|
flatten(java.util.Map srcMap, java.util.Map destMap)
Same as flatten(Map) but use |
static java.util.Map
|
toMapKey(java.lang.Object c, groovy.lang.Closure closure)
Generates a map where the key is each element of the 'collection' c provided and the value is closure(value). |
static java.util.Map
|
toMapValue(java.lang.Object c, groovy.lang.Closure closure)
Generates a map where the value is each element of the 'collection' c provided and the key is closure(value). |
Method Detail |
---|
static java.util.Map collectKey(java.util.Map srcMap, java.util.Map destMap, groovy.lang.Closure closure)
closure(k,v)
in the destination map under the same key.
destMap
static boolean compareContent(java.util.Collection c1, java.util.Collection c2)
static boolean compareIgnoreType(java.util.Map map1, java.util.Map map2)
static boolean compareIgnoreType(java.util.List list1, java.util.List list2)
static boolean compareIgnoreType(java.util.Set set1, java.util.Set set2)
static boolean compareIgnoreType(java.util.Collection c1, java.util.Collection c2)
static boolean compareIgnoreType(java.lang.Object o1, java.lang.Object o2)
static java.util.Map flatten(java.util.Map map)
[a: 1, 'b[0]': 1, 'b[1]': 2, 'c.d': 1]
static java.util.Map flatten(java.util.Map srcMap, java.util.Map destMap)
destMap
for the result
destMap
static java.util.Map toMapKey(java.lang.Object c, groovy.lang.Closure closure)
[1:2, 2:3] == toMapKey([1,2]) { it + 1 }
c
- only need to have an each(Closure)
method
static java.util.Map toMapValue(java.lang.Object c, groovy.lang.Closure closure)
[2:1, 3:2] == toMapValue([1,2]) { it + 1 }
c
- only need to have an each(Closure)
method
Groovy Documentation