@Test public void save_object_with_acl_parameter() { try { NCMBObject obj = new NCMBObject("TestClass", new JSONObject("{\"acl\":{\"*\":{\"read\":true, \"write\":true}}}")); obj.put("key", "value"); obj.save(); Assert.assertEquals("7FrmPTBKSNtVjajm", obj.getObjectId()); SimpleDateFormat df = NCMBDateFormat.getIso8601(); Assert.assertEquals(df.parse("2015-09-14T11:28:30.348Z"), obj.getCreateDate()); JSONAssert.assertEquals(obj.getAcl().toJson(), new JSONObject("{\"*\":{\"read\":true, \"write\":true}}"), false); } catch (NCMBException | JSONException | ParseException e) { Assert.fail(e.getMessage()); } }
public void save() throws NCMBException { NCMBObjectService objService = (NCMBObjectService) NCMB.factory(NCMB.ServiceType.OBJECT); JSONObject res = null; if (getObjectId() == null){ res = objService.saveObject(mClassName, mFields); } else { JSONObject updateJson = null; try { updateJson = createUpdateJsonData(); } catch (JSONException e) { throw new IllegalArgumentException(e.getMessage()); } res = objService.updateObject(mClassName, getObjectId(), updateJson); } setServerDataToProperties(res); mUpdateKeys.clear(); }
NCMBObject extends NCMBBase { public void save() throws NCMBException { NCMBObjectService objService = (NCMBObjectService) NCMB.factory(NCMB.ServiceType.OBJECT); JSONObject res = null; if (getObjectId() == null){ res = objService.saveObject(mClassName, mFields); } else { JSONObject updateJson = null; try { updateJson = createUpdateJsonData(); } catch (JSONException e) { throw new IllegalArgumentException(e.getMessage()); } res = objService.updateObject(mClassName, getObjectId(), updateJson); } setServerDataToProperties(res); mUpdateKeys.clear(); } }
NCMBObject extends NCMBBase { public void save() throws NCMBException { NCMBObjectService objService = (NCMBObjectService) NCMB.factory(NCMB.ServiceType.OBJECT); JSONObject res = null; if (getObjectId() == null){ res = objService.saveObject(mClassName, mFields); } else { JSONObject updateJson = null; try { updateJson = createUpdateJsonData(); } catch (JSONException e) { throw new IllegalArgumentException(e.getMessage()); } res = objService.updateObject(mClassName, getObjectId(), updateJson); } setServerDataToProperties(res); mUpdateKeys.clear(); } NCMBObject(String className);   NCMBObject(String className, JSONObject params); }
NCMBObject extends NCMBBase { public void save() throws NCMBException { NCMBObjectService objService = (NCMBObjectService) NCMB.factory(NCMB.ServiceType.OBJECT); JSONObject res = null; if (getObjectId() == null){ res = objService.saveObject(mClassName, mFields); } else { JSONObject updateJson = null; try { updateJson = createUpdateJsonData(); } catch (JSONException e) { throw new IllegalArgumentException(e.getMessage()); } res = objService.updateObject(mClassName, getObjectId(), updateJson); } setServerDataToProperties(res); mUpdateKeys.clear(); } NCMBObject(String className);   NCMBObject(String className, JSONObject params); void save(); void saveInBackground(final DoneCallback callback); void fetch(); void fetchInBackground(); void fetchInBackground(final FetchCallback callback); void deleteObject(); void deleteObjectInBackground(final DoneCallback callback); void increment(String key, int amount); void addToList(String key, List objects); void addUniqueToList(String key, List objects); void removeFromList(String key, List objects); }
NCMBObject extends NCMBBase { public void save() throws NCMBException { NCMBObjectService objService = (NCMBObjectService) NCMB.factory(NCMB.ServiceType.OBJECT); JSONObject res = null; if (getObjectId() == null){ res = objService.saveObject(mClassName, mFields); } else { JSONObject updateJson = null; try { updateJson = createUpdateJsonData(); } catch (JSONException e) { throw new IllegalArgumentException(e.getMessage()); } res = objService.updateObject(mClassName, getObjectId(), updateJson); } setServerDataToProperties(res); mUpdateKeys.clear(); } NCMBObject(String className);   NCMBObject(String className, JSONObject params); void save(); void saveInBackground(final DoneCallback callback); void fetch(); void fetchInBackground(); void fetchInBackground(final FetchCallback callback); void deleteObject(); void deleteObjectInBackground(final DoneCallback callback); void increment(String key, int amount); void addToList(String key, List objects); void addUniqueToList(String key, List objects); void removeFromList(String key, List objects);  }