use of jakarta.nosql.Settings in project jnosql-diana by eclipse.
the class DefaultSettingsTest method shouldGetEntrySet.
@Test
public void shouldGetEntrySet() {
Settings settings = Settings.of(singletonMap("key", "value"));
assertEquals(settings.entrySet().stream().findFirst().get().getKey(), "key");
}
use of jakarta.nosql.Settings in project jnosql-diana by eclipse.
the class ColumnFamilyManagerFactoryConverter method success.
@Override
public ColumnFamilyManagerFactory success(String value) {
final SettingsConverter settingsConverter = BeanManagers.getInstance(SettingsConverter.class);
Config config = BeanManagers.getInstance(Config.class);
final Settings settings = settingsConverter.convert(value);
String provider = value + ".provider";
final Class<?> configurationClass = config.getValue(provider, Class.class);
if (ColumnConfiguration.class.isAssignableFrom(configurationClass)) {
final Reflections reflections = BeanManagers.getInstance(Reflections.class);
final ColumnConfiguration configuration = (ColumnConfiguration) reflections.newInstance(configurationClass);
return configuration.get(settings);
}
throw new ConfigurationException("The class " + configurationClass + " is not valid to " + ColumnConfiguration.class);
}
Aggregations