old:
taskReportDataDTO.setUv(Long.valueOf(hbaseData.get(HbaseColumnEnum.uv).toString()));
new:
taskReportDataDTO.setPv(MapUtils.getLong(hbaseData, HbaseColumnEnum.pv.name().toLowerCase(), 0L));
http://commons.apache.org/proper/commons-collections/apidocs/org/apache/commons/collections4/MapUtils.html
static <K> Long |
getLong(Map<? super K,?> map, K key, Long defaultValue)
Looks up the given key in the given map, converting the result into a long, using the default value if the the conversion fails.
|