List of usage examples for org.apache.commons.collections MapUtils getLong
public static Long getLong(Map map, Object key, Long defaultValue)
From source file:com.produban.openbus.processor.util.CountByDate.java
public Map<String, Long> combine(Map<String, Long> val1, Map<String, Long> val2) { for (Map.Entry<String, Long> entry : val2.entrySet()) { val2.put(entry.getKey(), MapUtils.getLong(val1, entry.getKey(), 0L) + entry.getValue()); }/*from ww w.j a v a2s.co m*/ for (Map.Entry<String, Long> entry : val1.entrySet()) { if (val2.containsKey(entry.getKey())) { continue; } val2.put(entry.getKey(), entry.getValue()); } return val2; }