I have the following array of arrays in groovy
def userList = [[name: user1, id:0, ip: 127.0.0.1], [name: user2, id:1, ip: 127.0.0.2], [name: user3, id:2, ip: 127.0.0.3]]
I am iterating over another list rows and I want to extract the entries from the above list based on index.
rows.eachWithIndex { row, index ->
groovy.lang.Closure idMatch = { it.id == index }
def match = userList.findAll(idMatch)
println(match)
}
match is always returning empty.
The index value shows up correctly as 0,1,2 etc when I print it.
idin youruserListis not anIntegerit.id.toInteger()?idis...