class CreateDataSourcesStatementContextConverter implements SQLStatementContextConverter<CreateDataSourcesStatementContext, Map<String, YamlDataSourceParameter>> {

    @Override
    public Map<String, YamlDataSourceParameter> convert(final CreateDataSourcesStatementContext context) {
        Map<String, YamlDataSourceParameter> result = new LinkedHashMap<>(context.getSqlStatement().getConnectionInfos().size(), 1);
        for (DataSourceConnectionSegment each : context.getSqlStatement().getConnectionInfos()) {
            DataSourceParameter parameter = new DataSourceParameter();
            YamlDataSourceParameter dataSource = new YamlDataSourceParameter();
            dataSource.setUrl(context.getUrl(each));
            dataSource.setUsername(each.getUser());
            dataSource.setPassword(each.getPassword());
            dataSource.setMinPoolSize(parameter.getMinPoolSize());
            dataSource.setMaxPoolSize(parameter.getMaxPoolSize());
            dataSource.setConnectionTimeoutMilliseconds(parameter.getConnectionTimeoutMilliseconds());
            dataSource.setIdleTimeoutMilliseconds(parameter.getIdleTimeoutMilliseconds());
            dataSource.setMaintenanceIntervalMilliseconds(parameter.getMaintenanceIntervalMilliseconds());
            result.put(each.getName(), dataSource);
        }
        return result;
    }

}