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

website.automate.teamcity.agent.support.ContextParameterResolver Maven / Gradle / Ivy

package website.automate.teamcity.agent.support;

import java.util.HashMap;
import java.util.Map;
import java.util.Set;

public class ContextParameterResolver {

    private static final String CONTEXT_PARAMETER_PREFIX = "website.automate.context.";

    private static final ContextParameterResolver INSTANCE = new ContextParameterResolver();
    
    public static ContextParameterResolver getInstance(){
        return INSTANCE;
    }
    
    public Map resolve(Map runnerParameters){
        Map contextParameters = new HashMap();
        Set parameterNames = runnerParameters.keySet();
        for(String parameterName : parameterNames){
            if(parameterName.startsWith(CONTEXT_PARAMETER_PREFIX)){
                contextParameters.put(parameterName.substring(CONTEXT_PARAMETER_PREFIX.length()), runnerParameters.get(parameterName));
            }
        }
        return contextParameters;
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy