|
1 | 1 | package io.objectbox.sync; |
2 | 2 |
|
3 | | -import io.objectbox.annotation.apihint.Experimental; |
| 3 | +import io.objectbox.annotation.apihint.Beta; |
4 | 4 | import io.objectbox.sync.listener.SyncChangeListener; |
5 | 5 |
|
6 | 6 | // Note: this class is expected to be in this package by JNI, check before modifying/removing it. |
| 7 | + |
7 | 8 | /** |
8 | 9 | * A collection of changes made to one entity type during a sync transaction. |
9 | 10 | * Delivered via {@link SyncChangeListener}. |
10 | 11 | * IDs of changed objects are available via {@link #getChangedIds()} and those of removed objects via |
11 | 12 | * {@link #getRemovedIds()}. |
12 | 13 | */ |
13 | 14 | @SuppressWarnings({"unused", "WeakerAccess"}) |
14 | | -@Experimental |
| 15 | +@Beta |
15 | 16 | public class SyncChange { |
16 | | - final long entityTypeId; |
| 17 | + final int entityTypeId; |
17 | 18 |
|
18 | 19 | final long[] changedIds; |
19 | 20 | final long[] removedIds; |
20 | 21 |
|
21 | 22 | // 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) { |
23 | 24 | this.entityTypeId = entityTypeId; |
24 | 25 | this.changedIds = changedIds; |
25 | 26 | this.removedIds = removedIds; |
26 | 27 | } |
27 | 28 |
|
| 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 | + |
28 | 37 | /** |
29 | 38 | * The entity type ID; use methods like {@link io.objectbox.BoxStore#getEntityTypeIdOrThrow} to map with classes. |
30 | 39 | */ |
31 | | - public long getEntityTypeId() { |
| 40 | + public int getEntityTypeId() { |
32 | 41 | return entityTypeId; |
33 | 42 | } |
34 | 43 |
|
|
0 commit comments