com.pamirs.pradar.CutOffResult Maven / Gradle / Ivy
package com.pamirs.pradar;
import java.io.Serializable;
/**
* @author xiaobin.zfb
* @since 2020/7/1 1:56 下午
*/
public class CutOffResult implements Serializable {
private final static long serialVersionUID = 1L;
public static final CutOffResult PASSED = new CutOffResult(false, null);
/**
* 是否截流
*/
private boolean cutoff;
/**
* 替换参数
*/
private Object result;
public CutOffResult() {
}
public CutOffResult(boolean cutoff, Object result) {
this.cutoff = cutoff;
this.result = result;
}
public boolean isCutoff() {
return cutoff;
}
public void setCutoff(boolean cutoff) {
this.cutoff = cutoff;
}
public Object getResult() {
return result;
}
public void setResult(Object result) {
this.result = result;
}
public boolean isPassed() {
return !cutoff;
}
public static CutOffResult cutoff(Object result) {
return new CutOffResult(true, result);
}
public static CutOffResult passed() {
return new CutOffResult(false, null);
}
}