Skip to content

Instantly share code, notes, and snippets.

@herrphon
Last active August 11, 2020 07:50
Show Gist options
  • Save herrphon/e39a0299b51b79d7025a017e8af23727 to your computer and use it in GitHub Desktop.
Save herrphon/e39a0299b51b79d7025a017e8af23727 to your computer and use it in GitHub Desktop.

Revisions

  1. herrphon revised this gist Aug 11, 2020. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion groovy-map-a-hash-to-list.groovy
    Original file line number Diff line number Diff line change
    @@ -1,6 +1,6 @@

    def hash_to_param(myMap) {
    myMap.collect { k, v -> return [$class: 'StringParameterValue', name: k, value: v] }
    myMap.collect { k, v -> [$class: 'StringParameterValue', name: k, value: v] }
    }


  2. herrphon created this gist Aug 11, 2020.
    15 changes: 15 additions & 0 deletions groovy-map-a-hash-to-list.groovy
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,15 @@

    def hash_to_param(myMap) {
    myMap.collect { k, v -> return [$class: 'StringParameterValue', name: k, value: v] }
    }



    def map = [
    Bob : 42,
    Alice: 54,
    Max : 33
    ]

    print(hash_to_param(map))