blob: 9ed4a9eab123fae8bc1651811b1dcd503b0a24d3 [file] [log] [blame]
package autotest.common.table;
import com.google.gwt.json.client.JSONObject;
import com.google.gwt.json.client.JSONValue;
public abstract class FieldFilter extends Filter {
protected String fieldName;
protected boolean isExactMatch = true;
public FieldFilter(String fieldName) {
this.fieldName = fieldName;
}
public void setExactMatch(boolean exactMatch) {
isExactMatch = exactMatch;
}
public abstract JSONValue getMatchValue();
@Override
public void addParams(JSONObject params) {
String queryField = fieldName;
if (!isExactMatch) {
queryField += "__icontains";
}
params.put(queryField, getMatchValue());
}
}