/**
* @Author: www.itze.cn
* @Email: 814565718@qq.com
* getString:字段类型,
* key:JSONObject的key值
*/
JSONArray jsonArray = new JSONArray();
//升序
jsonArray.sort(Comparator.comparing(obj->((JSONObject)obj).getString("key")));
//降序
jsonArray.sort(Comparator.comparing(obj->((JSONObject)obj).getString("key")).reversed());