@Test public void delete_object_in_background_without_object_id() { NCMBObject obj = new NCMBObject("TestClass"); obj.deleteObjectInBackground(new DoneCallback() { @Override public void done(NCMBException e) { if (e == null) { Assert.fail("delete object method should raise exception:"); } else { Assert.assertEquals(NCMBException.REQUIRED, e.getCode()); } } }); }
public void deleteObjectInBackground (final DoneCallback callback) { NCMBObjectService objService = new NCMBObjectService(NCMB.getCurrentContext()); objService.deleteObjectInBackground(mClassName, getObjectId(), new ExecuteServiceCallback() { @Override public void done(JSONObject jsonData, NCMBException e) { if (e != null) { if (callback != null) { callback.done(e); } } else { mFields = new JSONObject(); mUpdateKeys.clear(); if (callback != null) { callback.done(null); } } } }); }
NCMBObject extends NCMBBase { public void deleteObjectInBackground (final DoneCallback callback) { NCMBObjectService objService = new NCMBObjectService(NCMB.getCurrentContext()); objService.deleteObjectInBackground(mClassName, getObjectId(), new ExecuteServiceCallback() { @Override public void done(JSONObject jsonData, NCMBException e) { if (e != null) { if (callback != null) { callback.done(e); } } else { mFields = new JSONObject(); mUpdateKeys.clear(); if (callback != null) { callback.done(null); } } } }); } }
NCMBObject extends NCMBBase { public void deleteObjectInBackground (final DoneCallback callback) { NCMBObjectService objService = new NCMBObjectService(NCMB.getCurrentContext()); objService.deleteObjectInBackground(mClassName, getObjectId(), new ExecuteServiceCallback() { @Override public void done(JSONObject jsonData, NCMBException e) { if (e != null) { if (callback != null) { callback.done(e); } } else { mFields = new JSONObject(); mUpdateKeys.clear(); if (callback != null) { callback.done(null); } } } }); } NCMBObject(String className);   NCMBObject(String className, JSONObject params); }
NCMBObject extends NCMBBase { public void deleteObjectInBackground (final DoneCallback callback) { NCMBObjectService objService = new NCMBObjectService(NCMB.getCurrentContext()); objService.deleteObjectInBackground(mClassName, getObjectId(), new ExecuteServiceCallback() { @Override public void done(JSONObject jsonData, NCMBException e) { if (e != null) { if (callback != null) { callback.done(e); } } else { mFields = new JSONObject(); mUpdateKeys.clear(); if (callback != null) { callback.done(null); } } } }); } 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 deleteObjectInBackground (final DoneCallback callback) { NCMBObjectService objService = new NCMBObjectService(NCMB.getCurrentContext()); objService.deleteObjectInBackground(mClassName, getObjectId(), new ExecuteServiceCallback() { @Override public void done(JSONObject jsonData, NCMBException e) { if (e != null) { if (callback != null) { callback.done(e); } } else { mFields = new JSONObject(); mUpdateKeys.clear(); if (callback != null) { callback.done(null); } } } }); } 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);  }