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

org.nutz.dao.impl.sql.SimpleVarSet Maven / Gradle / Ivy

Go to download

Nutz, which is a collections of lightweight frameworks, each of them can be used independently

There is a newer version: 1.r.72
Show newest version
package org.nutz.dao.impl.sql;

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

import org.nutz.dao.sql.VarSet;
import org.nutz.lang.Lang;

class SimpleVarSet implements VarSet {

    private static final long serialVersionUID = 1L;

    private HashMap map;

    SimpleVarSet() {
        this.map = new HashMap();
    }

    public VarSet set(String name, Object value) {
        map.put(name, value);
        return this;
    }

    public Object get(String name) {
        return map.get(name);
    }

    public Set keys() {
        return map.keySet();
    }

    public VarSet putAll(Map map) {
        if (map != null) {
            this.map.putAll(map);
        }
        return this;
    }

    public VarSet putAll(Object pojo) {
        if (pojo != null) {
            Map pojoMap = Lang.obj2map(pojo);
            this.map.putAll(pojoMap);
        }
        return this;
    }

    public int size() {
        return map.size();
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy