added constructor with predefined store

This commit is contained in:
Sebastian Sdorra
2018-12-18 14:55:38 +01:00
parent 4c0f993293
commit 13e3d54100

View File

@@ -42,8 +42,20 @@ package sonia.scm.store;
*/
public class InMemoryConfigurationStoreFactory implements ConfigurationStoreFactory {
private ConfigurationStore store;
public InMemoryConfigurationStoreFactory() {
}
public InMemoryConfigurationStoreFactory(ConfigurationStore store) {
this.store = store;
}
@Override
public ConfigurationStore getStore(TypedStoreParameters storeParameters) {
if (store != null) {
return store;
}
return new InMemoryConfigurationStore<>();
}
}