Search in sources :

Example 1 with SimpleMapPersistManager

use of com.tvd12.calabash.persist.manager.SimpleMapPersistManager in project calabash by youngmonkeys.

the class LocalExample method main.

public static void main(String[] args) {
    Settings settings = new SimpleSettings();
    MapPersistManager mapPersistManager = new SimpleMapPersistManager();
    BytesMapBackupExecutor backupExecutor = new SimpleBytesMapBackupExecutor();
    BytesMapPersistExecutor persistExecutor = SimpleBytesMapPersistExecutor.builder().mapPersistManager(mapPersistManager).build();
    BytesMap bytesMap = BytesMapImpl.builder().mapSetting(settings.getMapSetting("test")).mapBackupExecutor(backupExecutor).mapPersistExecutor(persistExecutor).build();
    bytesMap.loadAll();
    bytesMap.put(new ByteArray(new byte[] { 1, 2, 3 }), new byte[] { 1, 2, 3 });
    System.out.println(Arrays.toString(bytesMap.get(new ByteArray(new byte[] { 1, 2, 3 }))));
}
Also used : BytesMapBackupExecutor(com.tvd12.calabash.server.core.executor.BytesMapBackupExecutor) SimpleBytesMapBackupExecutor(com.tvd12.calabash.server.core.executor.SimpleBytesMapBackupExecutor) SimpleBytesMapPersistExecutor(com.tvd12.calabash.server.core.executor.SimpleBytesMapPersistExecutor) BytesMapPersistExecutor(com.tvd12.calabash.server.core.executor.BytesMapPersistExecutor) SimpleMapPersistManager(com.tvd12.calabash.persist.manager.SimpleMapPersistManager) SimpleSettings(com.tvd12.calabash.server.core.setting.SimpleSettings) SimpleBytesMapBackupExecutor(com.tvd12.calabash.server.core.executor.SimpleBytesMapBackupExecutor) BytesMap(com.tvd12.calabash.core.BytesMap) ByteArray(com.tvd12.calabash.core.util.ByteArray) SimpleSettings(com.tvd12.calabash.server.core.setting.SimpleSettings) Settings(com.tvd12.calabash.server.core.setting.Settings) MapPersistManager(com.tvd12.calabash.persist.manager.MapPersistManager) SimpleMapPersistManager(com.tvd12.calabash.persist.manager.SimpleMapPersistManager)

Aggregations

BytesMap (com.tvd12.calabash.core.BytesMap)1 ByteArray (com.tvd12.calabash.core.util.ByteArray)1 MapPersistManager (com.tvd12.calabash.persist.manager.MapPersistManager)1 SimpleMapPersistManager (com.tvd12.calabash.persist.manager.SimpleMapPersistManager)1 BytesMapBackupExecutor (com.tvd12.calabash.server.core.executor.BytesMapBackupExecutor)1 BytesMapPersistExecutor (com.tvd12.calabash.server.core.executor.BytesMapPersistExecutor)1 SimpleBytesMapBackupExecutor (com.tvd12.calabash.server.core.executor.SimpleBytesMapBackupExecutor)1 SimpleBytesMapPersistExecutor (com.tvd12.calabash.server.core.executor.SimpleBytesMapPersistExecutor)1 Settings (com.tvd12.calabash.server.core.setting.Settings)1 SimpleSettings (com.tvd12.calabash.server.core.setting.SimpleSettings)1