com.github.ltsopensource.ec.EventInfo Maven / Gradle / Ivy
package com.github.ltsopensource.ec;
import java.util.HashMap;
import java.util.Map;
/**
* 事件信息
* @author Robert HG ([email protected]) on 5/11/15.
*/
public class EventInfo {
private String topic;
private Map params;
public EventInfo(String topic) {
this.topic = topic;
}
public void setParam(String key, Object value) {
if (params == null) {
params = new HashMap();
}
params.put(key, value);
}
public Object removeParam(String key) {
if (params != null) {
return params.remove(key);
}
return null;
}
public Object getParam(String key) {
if (params != null) {
return params.get(key);
}
return null;
}
public Map getParams() {
return params == null ? new HashMap() : params;
}
public String getTopic() {
return topic;
}
public void setTopic(String topic) {
this.topic = topic;
}
}