@Test public void testHumanReadableByteCount() { assertTrue(NumericUtils.humanReadableByteCount(0).equals("0.0 B")); assertTrue(NumericUtils.humanReadableByteCount(27).equals("27.0 B")); assertTrue(NumericUtils.humanReadableByteCount(1023).equals("1023.0 B")); assertTrue(NumericUtils.humanReadableByteCount(1024).equals("1.0 KB")); assertTrue(NumericUtils.humanReadableByteCount(110592).equals("108.0 KB")); assertTrue(NumericUtils.humanReadableByteCount(28991029248L).equals("27.0 GB")); assertTrue(NumericUtils.humanReadableByteCount(1855425871872L).equals("1.7 TB")); assertTrue(NumericUtils.humanReadableByteCount(9223372036854775807L).equals("8.0 EB")); } }
NumericUtils.humanReadableByteCount((Double.valueOf(entry.toString()))); Map<String, Function<Object, String>> fieldNameToConverterMap = new HashMap<>(); fieldNameToConverterMap.put("Min", converterFunction);
entry -> NumericUtils.humanReadableByteCount((Double.valueOf(entry.toString()))); Map<String, Function<Object, String>> fieldNameToConverterMap = new HashMap<>(); fieldNameToConverterMap.put("Data-File Size", converterFunction);
})); Function<Object, String> converterFunction = entry -> NumericUtils.humanReadableByteCount((Double.valueOf(entry.toString()))); Map<String, Function<Object, String>> fieldNameToConverterMap = new HashMap<>(); fieldNameToConverterMap.put("Total Delta File Size", converterFunction);
return NumericUtils.humanReadableByteCount((Double.valueOf(entry.toString()))); });
return NumericUtils.humanReadableByteCount((Long.valueOf(entry.toString()))); });