lazy init

master
yihua.huang 2013-08-05 19:36:49 +08:00
parent dc9f574e27
commit 27ce3fc176
1 changed files with 7 additions and 1 deletions

View File

@ -33,7 +33,7 @@ public class Request {
/**
*
*/
private Map<String, Object> extras = new HashMap<String, Object>();
private Map<String, Object> extras;
private double priority;
@ -56,10 +56,16 @@ public class Request {
}
public Object getExtra(String key) {
if (extras==null){
return null;
}
return extras.get(key);
}
public Request putExtra(String key,Object value) {
if (extras==null){
extras = new HashMap<String, Object>();
}
extras.put(key,value);
return this;
}