Sunday 15 March 2015

arraylist - transform list of maps -



arraylist - transform list of maps -

i have array this:

def array = [[firstname:nick], [lastname:peter], [age:30]]

now want transform into:

def array = [firstname:nick, lastname:peter, age:30]

any help appreciated. thanks.

adding maps in groovy results in same behaviour. sum of list of maps gives same result:

def listofmaps = [[firstname:'nick'], [lastname:'peter'], [age:30]] assert [firstname:'nick', lastname:'peter', age:30] == listofmaps.sum()

arraylist groovy

No comments:

Post a Comment