I have created a LinkedHashMap, which produces a list of statuses in groovy. These are the results of a mysql query. I want to filter the results of my map to use key entries (statusName) in the map which start with the letter "O". However I am struggling to find how to do this with a map.
My code is as follows:
db.eachRow(reportQuery, [date]) {
cache.put(it.statusName, it.statusTickets)
}
cache.each{statusName, statusTickets ->
reportMetricsWithValues[statusName] = statusTickets
table.addData([metric:statusName, value: statusTickets])
}
This is the part of my code where I need to add this filter. The code is adding the key value metrics to a database table.