use of com.tvd12.calabash.core.util.ByteArray in project calabash by youngmonkeys.
the class SimpleBytesMapPersistExecutor method persist.
@Override
public void persist(MapSetting mapSetting, ByteArray key, byte[] value) {
BytesMapPersist mapPersist = getMapPersist(mapSetting);
if (mapPersist != null) {
PersistSaveOneAction action = new PersistSaveOneAction(key, value);
addPersistActionToQueue(mapSetting, action);
}
}
use of com.tvd12.calabash.core.util.ByteArray in project calabash by youngmonkeys.
the class EntityBytesMapPersist method persist.
@Override
public void persist(Map<ByteArray, byte[]> m) {
Map entities = new HashMap<>();
for (ByteArray key : m.keySet()) {
byte[] value = m.get(key);
Object keyEntity = entityCodec.deserialize(key.getBytes(), keyType);
Object valueEntity = entityCodec.deserialize(value, valueType);
entities.put(keyEntity, valueEntity);
}
entityMapPersist.persist(entities);
}
use of com.tvd12.calabash.core.util.ByteArray in project calabash by youngmonkeys.
the class EntityBytesMapPersist method serializeEntities.
protected Map<ByteArray, byte[]> serializeEntities(Map entities) {
Map<ByteArray, byte[]> answer = new HashMap<>();
for (Object keyEntity : entities.keySet()) {
Object valueEntity = entities.get(keyEntity);
byte[] key = entityCodec.serialize(keyEntity);
byte[] value = entityCodec.serialize(valueEntity);
answer.put(new ByteArray(key), value);
}
return answer;
}
use of com.tvd12.calabash.core.util.ByteArray in project calabash by youngmonkeys.
the class BytesMapPersist method persist.
default void persist(Map<ByteArray, byte[]> m) {
for (ByteArray key : m.keySet()) {
byte[] value = m.get(key);
persist(key, value);
}
}
Aggregations