use of com.duangframework.core.exceptions.EmptyNullException in project duangframework by tcrct.
the class AutoCreateDrlFile method createRuleWhen.
private static String createRuleWhen(List<ParamItem> paramItemList) {
if (ToolsKit.isEmpty(paramItemList)) {
throw new EmptyNullException("paramItemList is null");
}
StringBuilder paramItemString = new StringBuilder();
int size = paramItemList.size();
for (int i = 0; i < size; i++) {
ParamItem paramItem = paramItemList.get(i);
paramItemString.append("$ruleMap_").append(paramItem.getKey()).append(" : Map(this[\"").append(paramItem.getKey()).append("\"]");
paramItemString.append(" " + paramItem.getOperatorEnum().getValue() + " ");
Object valueObj = paramItem.getValue();
if (valueObj instanceof String) {
paramItemString.append("\"").append(valueObj).append("\"");
} else {
paramItemString.append(valueObj);
}
paramItemString.append(");");
if (i < (size - 1)) {
paramItemString.append(ENTER_FIELD).append(TAB_FIELD).append(TAB_FIELD);
}
}
return paramItemString.toString();
}
Aggregations