// Path: src/main/java/com/presidentio/testdatagenerator/cons/PropConst.java
// public class PropConst {
// 
//     public static final String TYPE = "type";
//     public static final String VALUE = "value";
//     public static final String SIZE = "size";
//     public static final String DOMAIN = "domain";
//     public static final String EXPR = "expr";
//     public static final String FILE = "file";
//     public static final String DELIMITER = "delimiter";
//     public static final String ITEMS = "items";
//     public static final String INDEX = "index";
//     public static final String HOST = "host";
//     public static final String PORT = "port";
//     public static final String CLUSTER_NAME = "clusterName";
//     public static final String CONNECTION_URL = "connectionUrl";
//     public static final String JDBC_DRIVER = "jdbcDriver";
//     public static final String DEPTH = "depth";
//     public static final String FIELD = "field";
//     public static final String VAR = "var";
//     public static final String OP = "op";
//     public static final String FORMAT = "format";
//     public static final String HEADER = "header";
//     public static final String SUFFIX = "suffix";
//     public static final String PREFIX = "prefix";
//     public static final String PATH_PROVIDER = "pathProvider";
//     public static final String BROKER_LIST = "brokerList";
//     public static final String GENDER = "gender";
// 
// }


import com.presidentio.testdatagenerator.cons.PropConst;
import org.apache.commons.io.IOUtils;
import java.io.IOException;
import java.io.InputStream;
import java.util.HashMap;
import java.util.Map;
package com.presidentio.testdatagenerator.provider;



/**
 * Created by Vitalii_Gergel on 2/11/2015.
 */
public class CountryProvider extends SelectProvider {

    private static String COUNTRIES;
    public static final String DELIMITER = "\r?\n";

    private String getCountries() {
        if (COUNTRIES == null) {
            try (InputStream nameStream = DefaultValueProviderFactory.class.getClassLoader().getResourceAsStream("country.dat")) {
                COUNTRIES = IOUtils.toString(nameStream);
            } catch (IOException e) {
                throw new RuntimeException("Failed to load names", e);
            }
        }
        return COUNTRIES;
    }

    @Override
    public void init(Map<String, String> props) {
        Map<String, String> propsCopy = new HashMap<>(props);
// Path: src/main/java/com/presidentio/testdatagenerator/cons/PropConst.java
// public class PropConst {
// 
//     public static final String TYPE = "type";
//     public static final String VALUE = "value";
//     public static final String SIZE = "size";
//     public static final String DOMAIN = "domain";
//     public static final String EXPR = "expr";
//     public static final String FILE = "file";
//     public static final String DELIMITER = "delimiter";
//     public static final String ITEMS = "items";
//     public static final String INDEX = "index";
//     public static final String HOST = "host";
//     public static final String PORT = "port";
//     public static final String CLUSTER_NAME = "clusterName";
//     public static final String CONNECTION_URL = "connectionUrl";
//     public static final String JDBC_DRIVER = "jdbcDriver";
//     public static final String DEPTH = "depth";
//     public static final String FIELD = "field";
//     public static final String VAR = "var";
//     public static final String OP = "op";
//     public static final String FORMAT = "format";
//     public static final String HEADER = "header";
//     public static final String SUFFIX = "suffix";
//     public static final String PREFIX = "prefix";
//     public static final String PATH_PROVIDER = "pathProvider";
//     public static final String BROKER_LIST = "brokerList";
//     public static final String GENDER = "gender";
// 
// }


// Path: src/main/java/com/presidentio/testdatagenerator/provider/CountryProvider.java
import com.presidentio.testdatagenerator.cons.PropConst;
import org.apache.commons.io.IOUtils;
import java.io.IOException;
import java.io.InputStream;
import java.util.HashMap;
import java.util.Map;

package com.presidentio.testdatagenerator.provider;



/**
 * Created by Vitalii_Gergel on 2/11/2015.
 */
public class CountryProvider extends SelectProvider {

    private static String COUNTRIES;
    public static final String DELIMITER = "\r?\n";

    private String getCountries() {
        if (COUNTRIES == null) {
            try (InputStream nameStream = DefaultValueProviderFactory.class.getClassLoader().getResourceAsStream("country.dat")) {
                COUNTRIES = IOUtils.toString(nameStream);
            } catch (IOException e) {
                throw new RuntimeException("Failed to load names", e);
            }
        }
        return COUNTRIES;
    }

    @Override
    public void init(Map<String, String> props) {
        Map<String, String> propsCopy = new HashMap<>(props);
        propsCopy.put(PropConst.ITEMS, getCountries());