Skip to content

Commit b1fffe7

Browse files
committed
SyncChange: fix entityTypeId type to int
1 parent 129146e commit b1fffe7

File tree

1 file changed

+14
-5
lines changed

1 file changed

+14
-5
lines changed

objectbox-java/src/main/java/io/objectbox/sync/SyncChange.java

Lines changed: 14 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,34 +1,43 @@
11
package io.objectbox.sync;
22

3-
import io.objectbox.annotation.apihint.Experimental;
3+
import io.objectbox.annotation.apihint.Beta;
44
import io.objectbox.sync.listener.SyncChangeListener;
55

66
// Note: this class is expected to be in this package by JNI, check before modifying/removing it.
7+
78
/**
89
* A collection of changes made to one entity type during a sync transaction.
910
* Delivered via {@link SyncChangeListener}.
1011
* IDs of changed objects are available via {@link #getChangedIds()} and those of removed objects via
1112
* {@link #getRemovedIds()}.
1213
*/
1314
@SuppressWarnings({"unused", "WeakerAccess"})
14-
@Experimental
15+
@Beta
1516
public class SyncChange {
16-
final long entityTypeId;
17+
final int entityTypeId;
1718

1819
final long[] changedIds;
1920
final long[] removedIds;
2021

2122
// Note: this constructor is called by JNI, check before modifying/removing it.
22-
public SyncChange(long entityTypeId, long[] changedIds, long[] removedIds) {
23+
public SyncChange(int entityTypeId, long[] changedIds, long[] removedIds) {
2324
this.entityTypeId = entityTypeId;
2425
this.changedIds = changedIds;
2526
this.removedIds = removedIds;
2627
}
2728

29+
// Old version called by JNI, remove after some grace period.
30+
@Deprecated
31+
public SyncChange(long entityTypeId, long[] changedIds, long[] removedIds) {
32+
this.entityTypeId = (int) entityTypeId;
33+
this.changedIds = changedIds;
34+
this.removedIds = removedIds;
35+
}
36+
2837
/**
2938
* The entity type ID; use methods like {@link io.objectbox.BoxStore#getEntityTypeIdOrThrow} to map with classes.
3039
*/
31-
public long getEntityTypeId() {
40+
public int getEntityTypeId() {
3241
return entityTypeId;
3342
}
3443

0 commit comments

Comments
 (0)