com.dooapp.gaedo.prevalence.space.basic.SimpleStorageSpace Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of gaedo-prevalence Show documentation
Show all versions of gaedo-prevalence Show documentation
A gaedo-inspired prevalence layer and the associated service, for making the most gaedo-efficient use of that layer
package com.dooapp.gaedo.prevalence.space.basic;
import java.io.Serializable;
import java.util.HashMap;
import java.util.Iterator;
import java.util.Map;
import com.dooapp.gaedo.prevalence.space.StorageSpace;
public class SimpleStorageSpace implements StorageSpace{
/**
* Effective storage map
*/
private Map storageMap;
public SimpleStorageSpace() {
this(new HashMap());
}
public SimpleStorageSpace(Map storageMap) {
this.storageMap = storageMap;
}
@Override
public boolean contains(Key key) {
return storageMap.containsKey(key);
}
@Override
public Object get(Key key) {
return storageMap.get(key);
}
@Override
public Object put(Key key, Object obj) {
return storageMap.put(key, obj);
}
@Override
public Object remove(Key key) {
return storageMap.remove(key);
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy