public class BaseContextImpl extends Object implements BaseContext, Serializable
Constructor and Description |
---|
BaseContextImpl() |
Modifier and Type | Method and Description |
---|---|
void |
clear()
删除上下文中的所有参数信息
|
BaseContext |
contain(String name)
如果上下文存在参数名称对应的参数信息,那么返回当前实例,不存在则返回null
|
boolean |
exist(String name)
检测参数是否存在
|
<T> T |
get(String name)
获取对象,如果当前环境中没有,则到子环境当中寻找
|
<T> T |
get(String name,
T defaultValue)
获取参数名称对应的参数值,如果参数值不存在,那么返回默认值
|
Map<String,Object> |
getItemMap()
返回上下文中所有参数
|
<T> T |
put(String name,
T object)
添加参数信息到上下文中
|
void |
putAll(Map<String,Object> map)
存储参数值
|
<T> T |
remove(String name)
移除参数名称对应的参数值
|
boolean |
renameKey(String key,
String newKey)
把环境中某键值的名字换成另外的名字
|
void |
setItemMap(Map<String,Object> itemMap) |
int |
size()
返回上下文中的参数数量
|
public <T> T put(String name, T object)
BaseContext
put
in interface BaseContext
name
- 参数名称object
- 参数值public <T> T remove(String name)
BaseContext
remove
in interface BaseContext
name
- 参数名称public <T> T get(String name)
BaseContext
get
in interface BaseContext
name
- 参数名称public void putAll(Map<String,Object> map)
BaseContext
putAll
in interface BaseContext
map
- 多个参数组成的map数据结构public <T> T get(String name, T defaultValue)
BaseContext
get
in interface BaseContext
name
- 参数名称defaultValue
- 默认值public boolean exist(String name)
BaseContext
exist
in interface BaseContext
name
- 参数名称public BaseContext contain(String name)
BaseContext
contain
in interface BaseContext
name
- 参数名称public void clear()
BaseContext
clear
in interface BaseContext
public Map<String,Object> getItemMap()
BaseContext
getItemMap
in interface BaseContext
public int size()
BaseContext
size
in interface BaseContext
public boolean renameKey(String key, String newKey)
BaseContext
renameKey
in interface BaseContext
key
- 旧的参数名称newKey
- 新的参数名称Copyright © 2006–2018 TinyGroup. All rights reserved.