group.rober.base.detector.DetectorContext Maven / Gradle / Ivy
The newest version!
package group.rober.base.detector;
import group.rober.runtime.lang.MapData;
import group.rober.runtime.lang.ValueObject;
import java.io.Serializable;
import java.util.Map;
/**
* 检查器上下文对象
*/
public class DetectorContext implements Serializable{
protected MapData params = new MapData();
/**
* 设置参数对象
*
* @param xpath xpath
* @param value value
* @return DetectorContext
*/
protected DetectorContext setParam(String xpath,Object value){
this.params.putValue(xpath,value);
return this;
}
protected DetectorContext setParam(Map param){
params.putAll(param);
return this;
}
public ValueObject getParam(String xpath){
return this.params.getValue(xpath);
}
public T getParam(String xpath,Class classType){
return this.params.getValue(xpath).objectVal(classType);
}
}