mirror of
https://github.com/scm-manager/scm-manager.git
synced 2026-02-02 04:39:14 +01:00
added constructor with predefined store
This commit is contained in:
@@ -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<>();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user