@Test public void testParseNumber() throws Exception { Number dblVal = FormatUtils.parseNumber("1.23"); Number intVal = FormatUtils.parseNumber("1"); try { FormatUtils.parseNumber("invalid"); fail("Should be unable to parse string value 'invalid'"); } catch (ParseException e) { } assertThat(dblVal, instanceOf(Double.class)); assertThat("Expecting parsed value to be equal to 1.23", Double.compare((Double) dblVal, 1.23d), is(0)); assertThat(intVal, instanceOf(Long.class)); assertThat("Expecting parsed value to be equal to 1L", Long.compare((Long) intVal, 1L), is(0)); }
public static Number parseNumber(String value) throws ParseException { return NumberFormat.getInstance().parse(value); }
FormatUtils { public static Number parseNumber(String value) throws ParseException { return NumberFormat.getInstance().parse(value); } }
FormatUtils { public static Number parseNumber(String value) throws ParseException { return NumberFormat.getInstance().parse(value); } private  FormatUtils(); }
FormatUtils { public static Number parseNumber(String value) throws ParseException { return NumberFormat.getInstance().parse(value); } private  FormatUtils(); static ZonedDateTime parseUTCTime(String value); static Number parseNumber(String value); static String formatNumber(Number value); static String formatNumberFiveCharLimit(Number value); static String formatMillisOrSeconds(Number value); static String generateDefaultValueMessage(String metric, Number value); }
FormatUtils { public static Number parseNumber(String value) throws ParseException { return NumberFormat.getInstance().parse(value); } private  FormatUtils(); static ZonedDateTime parseUTCTime(String value); static Number parseNumber(String value); static String formatNumber(Number value); static String formatNumberFiveCharLimit(Number value); static String formatMillisOrSeconds(Number value); static String generateDefaultValueMessage(String metric, Number value);  }