Created
April 13, 2018 14:48
-
-
Save jeffscottbrown/d880b7f73ac5668501d9c9f2dd26217b to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| groovy:000> initialMap = [name: 'Jeff', company: 'OCI'] | |
| ===> [name:Jeff, company:OCI] | |
| groovy:000> | |
| groovy:000> secondMap = initialMap.collectEntries { k, v -> | |
| groovy:001> ["-$k", v] | |
| groovy:002> } | |
| ===> [-name:Jeff, -company:OCI] | |
| groovy:000> | |
| groovy:000> println "Initial Map: $initialMap" | |
| Initial Map: [name:Jeff, company:OCI] | |
| ===> null | |
| groovy:000> println "Second Map: $secondMap" | |
| Second Map: [-name:Jeff, -company:OCI] | |
| ===> null | |
| groovy:000> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment