use of org.apache.commons.configuration2.CompositeConfiguration in project bitflyer4j by after-the-sunrise.
the class Bitflyer4jFactory method createConfiguration.
/**
* Create a {@link Configuration} instance,
* composed of multiple configurations which are enumerated in {@link ConfigurationType}.
*
* @return Composite configuration instance.
*/
@VisibleForTesting
AbstractConfiguration createConfiguration(Properties properties) {
CompositeConfiguration composite = new CompositeConfiguration();
ConfigurationType[] types = ConfigurationType.values();
Arrays.stream(types).forEach(s -> s.get().ifPresent(composite::addConfiguration));
Optional.ofNullable(properties).ifPresent(p -> composite.addConfiguration(new MapConfiguration(p)));
return composite;
}
Aggregations