use of doitincloud.rdbcache.models.KeyInfo in project rdbcache by rdbcache.
the class ExpireOps method setExpireKey.
public void setExpireKey(Context context, KvPairs pairs, AnyKey anyKey) {
for (int i = 0; i < pairs.size(); i++) {
KvPair pair = pairs.get(i);
KeyInfo keyInfo = anyKey.getAny(i);
setExpireKey(context, pair, keyInfo);
}
}
use of doitincloud.rdbcache.models.KeyInfo in project rdbcache by rdbcache.
the class AbsDbaseRepo method update.
@Override
public boolean update(final Context context, final KvPairs pairs, final AnyKey anyKey) {
boolean allOk = true;
for (int i = 0; i < pairs.size(); i++) {
KvPair pair = pairs.get(i);
KeyInfo keyInfo = anyKey.getAny(i);
if (!update(context, pair, keyInfo)) {
allOk = false;
}
}
return allOk;
}
use of doitincloud.rdbcache.models.KeyInfo in project rdbcache by rdbcache.
the class AbsDbaseRepo method delete.
@Override
public boolean delete(final Context context, final KvPairs pairs, final AnyKey anyKey) {
boolean allOk = true;
for (int i = 0; i < pairs.size(); i++) {
KvPair pair = pairs.get(i);
KeyInfo keyInfo = anyKey.getAny(i);
if (!delete(context, pair, keyInfo)) {
allOk = false;
}
}
return allOk;
}
use of doitincloud.rdbcache.models.KeyInfo in project rdbcache by rdbcache.
the class AnyKeyTest method getKey.
@Test
public void getKey() {
AnyKey anyKey;
KeyInfo keyInfo;
anyKey = new AnyKey();
keyInfo = anyKey.getKeyInfo();
assertNull(keyInfo);
keyInfo = new KeyInfo();
keyInfo.setExpire("100");
keyInfo.setTable("table");
anyKey = new AnyKey(keyInfo);
KeyInfo keyInfo2 = anyKey.getKeyInfo();
assertNotNull(keyInfo2);
assertTrue(keyInfo == keyInfo2);
}
use of doitincloud.rdbcache.models.KeyInfo in project rdbcache by rdbcache.
the class AnyKeyTest method setKey.
@Test
public void setKey() {
AnyKey anyKey;
KeyInfo keyInfo;
anyKey = new AnyKey();
keyInfo = new KeyInfo();
keyInfo.setExpire("100");
keyInfo.setTable("table");
anyKey.setKeyInfo(keyInfo);
assertEquals(1, anyKey.size());
assertTrue(keyInfo == anyKey.get(0));
anyKey = new AnyKey(new KeyInfo());
anyKey.setKeyInfo(keyInfo);
assertEquals(1, anyKey.size());
assertTrue(keyInfo == anyKey.get(0));
}
Aggregations