
io.magentys.commons.memory.MemoryVersioned Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of magentys-commons Show documentation
Show all versions of magentys-commons Show documentation
Common utilities to support testing
The newest version!
package io.magentys.commons.memory;
import io.magentys.commons.typemap.TypedKey;
import io.magentys.commons.typemap.TypedKeyMapVersioned;
import io.magentys.commons.typemap.Versions;
public class MemoryVersioned {
private final TypedKeyMapVersioned values = new TypedKeyMapVersioned();
public MemoryVersioned commit(TypedKey key, T value) {
values.put(key, value);
return this;
}
public T recall(TypedKey key) {
return values.get(key);
}
public T recall(TypedKey key, T defaultValue) {
T value = recall(key);
return (value == null) ? defaultValue : value;
}
public Versions recallAll(TypedKey key) {
return values.getVersions(key);
}
public int size(TypedKey key) {
return values.getVersions(key).size();
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy