class WXJsonUtils {

  public @NonNull static String fromObjectToJSONString(Object obj, boolean WriteNonStringKeyAsString){
    try {
      if(WriteNonStringKeyAsString) {
        return JSON.toJSONString(obj, SerializerFeature.WriteNonStringKeyAsString);
      }else {
        return JSON.toJSONString(obj);
      }
    }catch(Exception e){
      if(WXEnvironment.isApkDebugable()){
        throw new WXRuntimeException("fromObjectToJSONString parse error!");
      }
      WXLogUtils.e("fromObjectToJSONString error:", e);
      return "{}";
    }
  }

}