Skip to content

Commit

Permalink
Add mergeNotNull to MapUtil class
Browse files Browse the repository at this point in the history
  • Loading branch information
dolfinus committed Sep 23, 2019
1 parent d0d978a commit 4de3cf9
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions src/org/camunda/latera/bss/utils/MapUtil.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,18 @@ class MapUtil {
return (input.keySet() as String[])
}

static Map mergeNotNull(Map first, Map second) {
LinkedHashMap result = [:]
first.each { key, value ->
if (value == null && second[key] != null) {
result[key] = second[key]
} else {
result[key] = value
}
}
return result
}

static Integer keysCount(Map input) {
return keysList(input)?.size() ?: 0
}
Expand Down

0 comments on commit 4de3cf9

Please sign in to comment.