All Downloads are FREE. Search and download functionalities are using the official Maven repository.

net.thucydides.core.webdriver.OptionsMap Maven / Gradle / Ivy

There is a newer version: 4.2.1
Show newest version
package net.thucydides.core.webdriver;

import com.google.common.base.Splitter;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

/**
 * Created by john on 14/07/2017.
 */
public class OptionsMap {

    public static Map from(String options) {
        List optionValues = Splitter.on(";").splitToList(options);
        Map optionsMap = new HashMap();
        for (String optionValue : optionValues) {
            if (optionValue.contains("=")) {
                int equalsSign = optionValue.indexOf("=");
                String optionKey = optionValue.substring(0, equalsSign);
                String optionKeyValue = optionValue.substring(equalsSign + 1);
                optionsMap.put(optionKey, optionKeyValue);
            }
        }
        return optionsMap;
    }

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy