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

hudson.scm.ParametrizedModuleLocationImpl Maven / Gradle / Ivy

There is a newer version: 2.2.2
Show newest version
package hudson.scm;

import hudson.scm.util.ParamUtils;
import java.util.Map;

public class ParametrizedModuleLocationImpl implements ModuleLocation {

    /**
     * {@link ModuleLocation} with populated parameters in the properties.
     */
    ModuleLocation location;

    /**
     * Constructs ParametrizedModule based on location module and map of parameters.
     *
     * @param location module location.
     * @param params map with parameters.
     */
    public ParametrizedModuleLocationImpl(ModuleLocation location, Map params) {
        this.location = new ModuleLocationImpl(ParamUtils.populateParamValues(location.getCvsroot(), params),
            ParamUtils.populateParamValues(location.getModule(), params),
            ParamUtils.populateParamValues(location.getBranch(), params), location.isTag(),
            ParamUtils.populateParamValues(location.getLocalDir(), params));
    }

    /**
     * @inheritDoc
     */
    public String getCvsroot() {
        return location != null ? location.getCvsroot() : null;
    }

    /**
     * @inheritDoc
     */
    public String getModule() {
        return location != null ? location.getModule() : null;
    }

    /**
     * @inheritDoc
     */
    public String getBranch() {
        return location != null ? location.getBranch() : null;
    }

    /**
     * @inheritDoc
     */
    public boolean isTag() {
        return location != null && location.isTag();
    }

    /**
     * @inheritDoc
     */
    public String getLocalDir() {
        return location != null ? location.getLocalDir() : null;
    }

    /**
     * @inheritDoc
     */
    public String[] getNormalizedModules() {
        return ParamUtils.getNormalizedModules(getModule());
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy