Refactoring

pull/152/head
M66B 6 years ago
parent 86ca2c00fc
commit 4b308382c9

@ -80,24 +80,13 @@ public class EntityOperation {
static final String ATTACHMENT = "attachment"; static final String ATTACHMENT = "attachment";
static final String SYNC = "sync"; static final String SYNC = "sync";
static void queue(Context context, DB db, EntityMessage message, String name) { static void queue(Context context, DB db, EntityMessage message, String name, Object... values) {
JSONArray jargs = new JSONArray();
queue(context, db, message, name, jargs);
}
static void queue(Context context, DB db, EntityMessage message, String name, Object value) {
JSONArray jargs = new JSONArray(); JSONArray jargs = new JSONArray();
for (Object value : values)
jargs.put(value); jargs.put(value);
queue(context, db, message, name, jargs); queue(context, db, message, name, jargs);
} }
static void queue(Context context, DB db, EntityMessage message, String name, Object value1, Object value2) {
JSONArray jargs = new JSONArray();
jargs.put(value1);
jargs.put(value2);
queue(context, db, message, name, jargs);
}
static void sync(Context context, long fid) { static void sync(Context context, long fid) {
DB db = DB.getInstance(context); DB db = DB.getInstance(context);
if (db.operation().getOperationCount(fid, EntityOperation.SYNC) == 0) { if (db.operation().getOperationCount(fid, EntityOperation.SYNC) == 0) {

Loading…
Cancel
Save