shenjingwei hace 2 semanas
padre
commit
7f3601f689
Se han modificado 1 ficheros con 5 adiciones y 0 borrados
  1. 5 0
      src/override/com/alibaba/fastjson2/JSONObject.java

+ 5 - 0
src/override/com/alibaba/fastjson2/JSONObject.java

@@ -201,6 +201,11 @@ public class JSONObject
         }
     }
 
+    public JSONArray getJSONArrayValue(String key, JSONArray defaultvalue) {
+        JSONArray jsonArray = getJSONArray(key);
+        return jsonArray == null ? defaultvalue : jsonArray;
+    }
+
     /**
      * Returns the {@link JSONArray} of the associated keys in this {@link JSONObject}.
      *