com.zipwhip.util.KeyValueStoreAdapter Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of zipwhip-api Show documentation
Show all versions of zipwhip-api Show documentation
Java client to support applications powered by the Zipwhip Cloud
The newest version!
package com.zipwhip.util;
/**
* Created with IntelliJ IDEA.
* User: Michael
* Date: 9/13/12
* Time: 5:36 PM
*
* Extend this to adapt different stores.
*/
public abstract class KeyValueStoreAdapter implements KeyValueStore {
private final KeyValueStore store;
public KeyValueStoreAdapter(KeyValueStore store) {
this.store = store;
}
@Override
public void put(KExternal key, V value) {
store.put(getKey(key), value);
}
@Override
public V get(KExternal key) {
return store.get(getKey(key));
}
protected abstract KInternal getKey(KExternal key);
@Override
public void remove(KExternal key) {
store.remove(getKey(key));
}
@Override
public void clear() {
store.clear();
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy