1 Star 0 Fork 22

linving/WebJava

forked from 老馬/WebJava 
加入 Gitee
与超过 1400万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
BaseTemplate.java 1.77 KB
一键复制 编辑 原始数据 按行查看 历史
Ma 提交于 2015-06-12 09:41 +08:00 . 添加Demo
/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package Web;
import java.util.HashMap;
/**
* @author Ma
*/
public class BaseTemplate {
public HashMap param;
public BaseTemplate() {
this.param = new HashMap();
}
public String display() {
return null;
}
public String get(String s) {
if (this.param.containsKey(s)) {
return this.param.get(s).toString();
} else {
return null;
}
}
/**
* 获取boolean值
*
* @param s
* @return
*/
public boolean getBoolean(String s) {
Boolean bool = (Boolean) this.param.get(s);
return bool.booleanValue();
}
/**
* 获取int值
*
* @param s
* @return
*/
public int getInt(String s) {
Integer num = (Integer) this.param.get(s);
return num.intValue();
}
/**
* 获取一维数组
*
* @param s
* @return
*/
public Object[] getArray(String s) {
return (Object[]) this.param.get(s);
}
/**
* 获取二维数组
*
* @param s
* @return
*/
public Object[][] getArray2(String s) {
return (Object[][]) this.param.get(s);
}
/**
* 赋值操作
*/
public void assign(String key, String value) {
this.param.put(key, value);
}
/**
* 赋值操作
*/
public void assign(String key, int value) {
this.param.put(key, value);
}
/**
* 赋值操作
*/
public void assign(String key, boolean value) {
this.param.put(key, value);
}
/**
* 赋值操作
*/
public void assign(String key, Object[] value) {
this.param.put(key, value);
}
}
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/linving/WebJava.git
git@gitee.com:linving/WebJava.git
linving
WebJava
WebJava
master

搜索帮助