/** * Removes the objects and every object they point to in the local datastore, recursively. * * @return A {@link bolts.Task} that is resolved when unpinning all completes. * @see #pinAllInBackground(java.util.List, SaveCallback) * @see #DEFAULT_PIN */ public static Task<Void> unpinAllInBackground() { return unpinAllInBackground(DEFAULT_PIN); }
/** * Removes the objects and every object they point to in the local datastore, recursively. * * @param objects the objects * @return A {@link bolts.Task} that is resolved when unpinning all completes. * @see #pinAllInBackground(java.util.List) * @see #DEFAULT_PIN */ public static <T extends ParseObject> Task<Void> unpinAllInBackground(List<T> objects) { return unpinAllInBackground(DEFAULT_PIN, objects); }
/** * Removes the object and every object it points to in the local datastore, recursively. * * @return A {@link bolts.Task} that is resolved when unpinning completes. * @see #pinInBackground() * @see #DEFAULT_PIN */ public Task<Void> unpinInBackground() { return unpinAllInBackground(DEFAULT_PIN, Collections.singletonList(this)); }
/** * Removes the object and every object it points to in the local datastore, recursively. * * @return A {@link bolts.Task} that is resolved when unpinning completes. * @see #pinInBackground(String) */ public Task<Void> unpinInBackground(String name) { return unpinAllInBackground(name, Collections.singletonList(this)); }
@Override public Task<Void> setAsync(final T object) { return ParseObject.unpinAllInBackground(pinName).continueWithTask(new Continuation<Void, Task<Void>>() { @Override public Task<Void> then(Task<Void> task) { return object.pinInBackground(pinName, false); } }); }
/** * Removes the objects and every object they point to in the local datastore, recursively. * * @param callback the callback * @see #pinAllInBackground(java.util.List, SaveCallback) * @see #DEFAULT_PIN */ public static void unpinAllInBackground(DeleteCallback callback) { ParseTaskUtils.callbackOnMainThreadAsync(unpinAllInBackground(), callback); }
/** * Removes the objects and every object they point to in the local datastore, recursively. * * @param name the name * @param objects the objects * @param callback the callback * @see #pinAllInBackground(String, java.util.List, SaveCallback) */ public static <T extends ParseObject> void unpinAllInBackground(String name, List<T> objects, DeleteCallback callback) { ParseTaskUtils.callbackOnMainThreadAsync(unpinAllInBackground(name, objects), callback); }
/** * Removes the objects and every object they point to in the local datastore, recursively. * * @param name the name * @throws ParseException exception if fails * @see #pinAll(String, java.util.List) */ public static void unpinAll(String name) throws ParseException { ParseTaskUtils.wait(unpinAllInBackground(name)); }
/** * Removes the objects and every object they point to in the local datastore, recursively. * * @param name the name * @param objects the objects * @throws ParseException exception if fails * @see #pinAll(String, java.util.List) */ public static <T extends ParseObject> void unpinAll(String name, List<T> objects) throws ParseException { ParseTaskUtils.wait(unpinAllInBackground(name, objects)); }
/** * Removes the objects and every object they point to in the local datastore, recursively. * * @param objects the objects * @param callback the callback * @see #pinAllInBackground(java.util.List, SaveCallback) * @see #DEFAULT_PIN */ public static <T extends ParseObject> void unpinAllInBackground(List<T> objects, DeleteCallback callback) { ParseTaskUtils.callbackOnMainThreadAsync(unpinAllInBackground(DEFAULT_PIN, objects), callback); }
/** * Removes the objects and every object they point to in the local datastore, recursively. * * @param objects the objects * @throws ParseException exception if fails * @see #pinAll(java.util.List) * @see #DEFAULT_PIN */ public static <T extends ParseObject> void unpinAll(List<T> objects) throws ParseException { ParseTaskUtils.wait(unpinAllInBackground(DEFAULT_PIN, objects)); }
/** * Removes the objects and every object they point to in the local datastore, recursively. * * @param name the name * @param callback the callback * @see #pinAll(String, java.util.List) */ public static void unpinAllInBackground(String name, DeleteCallback callback) { ParseTaskUtils.callbackOnMainThreadAsync(unpinAllInBackground(name), callback); }
/** * Removes the objects and every object they point to in the local datastore, recursively. * * @throws ParseException exception if fails * @see #pinAll(java.util.List) * @see #DEFAULT_PIN */ public static void unpinAll() throws ParseException { ParseTaskUtils.wait(unpinAllInBackground()); }
@Override public Task<Void> deleteAsync() { final Task<Void> ldsTask = ParseObject.unpinAllInBackground(pinName); return Task.whenAll(Arrays.asList( legacy.deleteAsync(), ldsTask )).continueWithTask(new Continuation<Void, Task<Void>>() { @Override public Task<Void> then(Task<Void> task) { // We only really care about the result of unpinning. return ldsTask; } }); } }
public static void unpinAndRepin(final List data, final String pinName) { // Unpin old data and pin new data to local datastore ParseObject.unpinAllInBackground(pinName, new DeleteCallback() { @Override public void done(ParseException e) { if (e == null) { // Add the latest results for this query to the cache. Log.d("PARSE_PIN_WIN", pinName); ParseObject.pinAllInBackground(pinName, data); } else { Log.d("PARSE_PIN_ERROR", e.toString()); } } }); } }
@NonNull public static <R extends ParseObject> Completable unpin(@NonNull final List<R> objects) { return RxTask.completable(() -> ParseObject.unpinAllInBackground(objects)); }
@NonNull public static <R extends ParseObject> Completable unpin(@NonNull final String name, @NonNull final List<R> objects) { return RxTask.completable(() -> ParseObject.unpinAllInBackground(name, objects)); }