class ParamFlowRuleUtil {

    static Map<Object, Integer> parseHotItems(List<ParamFlowItem> items) {
        if (items == null || items.isEmpty()) {
            return new HashMap<>();
        }
        Map<Object, Integer> itemMap = new HashMap<>(items.size());
        for (ParamFlowItem item : items) {
            // Value should not be null.
            Object value;
            try {
                value = parseItemValue(item.getObject(), item.getClassType());
            } catch (Exception ex) {
                RecordLog.warn("[ParamFlowRuleUtil] Failed to parse value for item: " + item, ex);
                continue;
            }
            if (item.getCount() == null || item.getCount() < 0 || value == null) {
                RecordLog.warn("[ParamFlowRuleUtil] Ignoring invalid exclusion parameter item: " + item);
                continue;
            }
            itemMap.put(value, item.getCount());
        }
        return itemMap;
    }

    private  ParamFlowRuleUtil();

}