/** * Used to build a measure from the current object * * @param allowEmptyData should be built if current object is empty * @return the built measure */ public Measure build(boolean allowEmptyData) { if (!isEmpty() || allowEmptyData) { //-1 is a hack to include zero values return new Measure(metric, KeyValueFormat.format(countBag, -1)); } return null; }