final_map = ["/7amd64-Aug2022.1":"2022-08-09","/7amd64-Oct2022.1":"2022-10-12","/7":"2022-11-08","/7amd64-Jul2022.1":"2022-07-12","/7amd64":"2022-11-08","/7amd64-June2022.1":"2022-06-14","/7amd64-beta":"2022-11-08","/7amd64-Sep2022.1":"2022-09-14","/7amd64-Nov2022.1":"2022-11-08","/_uploads":"2022-11-08"]
Jenkins管道(下面是我的代码,这是不工作)
result = final_map.sort { a,b -> a.value <=> b.value }
echo "Output: ${result}"
期望使用日期(值)对Map进行排序。
1条答案
按热度按时间f3temu5u1#
您可以为此使用自定义比较器。检查以下Groovy代码。