Skip to content

Commit 74a2b36

Browse files
committed
Deprecate Box.removeByKeys() in favor of removeByIds()
1 parent 1709164 commit 74a2b36

2 files changed

Lines changed: 8 additions & 2 deletions

File tree

  • objectbox-java/src/main/java/io/objectbox
  • tests/objectbox-java-test/src/test/java/io/objectbox

objectbox-java/src/main/java/io/objectbox/Box.java

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -420,10 +420,16 @@ public void remove(@Nullable long... ids) {
420420
}
421421
}
422422

423+
@Deprecated
424+
/** @deprecated use {@link #removeByIds(Collection)} instead. */
425+
public void removeByKeys(@Nullable Collection<Long> ids) {
426+
removeByIds(ids);
427+
}
428+
423429
/**
424430
* Due to type erasure collision, we cannot simply use "remove" as a method name here.
425431
*/
426-
public void removeByKeys(@Nullable Collection<Long> ids) {
432+
public void removeByIds(@Nullable Collection<Long> ids) {
427433
if (ids == null || ids.isEmpty()) {
428434
return;
429435
}

tests/objectbox-java-test/src/test/java/io/objectbox/BoxTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -244,7 +244,7 @@ public void testCollectionsNull() {
244244
box.put((TestEntity[]) null);
245245
box.remove((Collection) null);
246246
box.remove((long[]) null);
247-
box.removeByKeys(null);
247+
box.removeByIds(null);
248248
}
249249

250250
@Test

0 commit comments

Comments
 (0)