filters.addFilter(field, flag, value);
}
public void isValid(TDHSCommon.ProtocolVersion version) throws TDHSEncodeException {
if (tableInfo == null) {
throw new TDHSEncodeException("tableInfo can't be empty!");
}
tableInfo.isValid(version);
if (_key == null || _key.size() == 0) {
throw new TDHSEncodeException("key can't be missing!");
}
if (version.equals(TDHSCommon.ProtocolVersion.V1)) {
if (_key.size() > TDHSCommon.REQUEST_MAX_KEY_NUM) {
throw new TDHSEncodeException("too many keys(in) ,larger than 10!");
}
}
for (String[] k : _key) {
if (k == null || k.length == 0) {
throw new TDHSEncodeException("key can't be empty!");
}
if (k.length > TDHSCommon.REQUEST_MAX_KEY_NUM) {
throw new TDHSEncodeException("too many keys ,larger than 10!");
}
}
if (filters != null) {
filters.isValid(version);
}
if (____find_flag == TDHSCommon.FindFlag.TDHS_BETWEEN.getValue() && _key.size() < 2) {
throw new TDHSEncodeException("between need at least 2 keys");
}
}