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

com.cloudbees.api.config.ParameterHolder Maven / Gradle / Ivy

There is a newer version: 1.5.9
Show newest version
package com.cloudbees.api.config;

import com.thoughtworks.xstream.annotations.XStreamImplicit;

/**
 * {@link Environment} and {@link ConfigParameters} can both own parameters, hence this class.
 *
 * @author Kohsuke Kawaguchi
 */
public class ParameterHolder {
    @XStreamImplicit(itemFieldName="param")
    private ParameterList parameters;

    @XStreamImplicit(itemFieldName="runtime-param")
    private ParameterList runtimeParameters;

    /**
     * Parameters are string-to-string map, made available to
     * applications as system properties.
     *
     * @return
     *      This method always returns the same live map. Update to this map
     *      gets reflected to the {@link ConfigParameters}.
     */
    public ParameterMap getParameters() {
        if (parameters == null)
            parameters = new ParameterList();
        return parameters.asMap();
    }

    /**
     * Runtime parameters are used to communicate with the stack
     * that runs your application (as opposed to the application itself.)
     *
     * @return
     *      This method always returns the same live map. Update to this map
     *      gets reflected to the {@link ConfigParameters}.
     */
    public ParameterMap getRuntimeParameters() {
        if (runtimeParameters == null)
            runtimeParameters = new ParameterList();
        return runtimeParameters.asMap();
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy