org.nutz.dao.impl.sql.SimpleVarSet Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of nutz Show documentation
Show all versions of nutz Show documentation
Nutz, which is a collections of lightweight frameworks, each of them can be used independently
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();
}
}