package cc.smtweb.framework.core.container.base;

/**
 * Created by Akmm at 2011-1-12 9:41:41
 * 输入参数
 */
public class SwParameter extends java.util.HashMap<String, Object> {

    private Object singleParam;

    public <T> T  getSingleParam() {
        return (T)singleParam;
    }

    public void setSingleParam(Object singleParam) {
        this.singleParam = singleParam;
    }

    /**
     * 得到参数值
     *
     * @param name 参数名
     * @param <T>  参数类型
     * @return 参数值
     */
    @SuppressWarnings({"unchecked"})
    public <T> T getParameter(String name) {
        return (T) get(name);
    }

    /**
     * 设置参数值
     *
     * @param name  参数名
     * @param value 参数值
     */
    public void setParameter(String name, Object value) {
        put(name, value);
    }
}
