@Test public void parseInt() throws Exception { Assert.assertEquals(123, MathUtils.parseInt("123")); Assert.assertEquals(0, MathUtils.parseInt("a123")); Assert.assertEquals(0, MathUtils.parseInt("999999999999")); }
public static int parseInt(String numberString) { try { return Integer.parseInt(numberString); } catch (NumberFormatException ex) { return 0; } }
MathUtils { public static int parseInt(String numberString) { try { return Integer.parseInt(numberString); } catch (NumberFormatException ex) { return 0; } } }
MathUtils { public static int parseInt(String numberString) { try { return Integer.parseInt(numberString); } catch (NumberFormatException ex) { return 0; } }  }
MathUtils { public static int parseInt(String numberString) { try { return Integer.parseInt(numberString); } catch (NumberFormatException ex) { return 0; } }  static boolean isNumber(String numberString); static boolean isInteger(String numberString); static boolean isLong(String numberString); static int parseInt(String numberString); static long parseLong(String numberString); static double round(double sourceNum, int scale); static int castToInt(Object value); static long castToLong(Object value); static double castToDouble(Object value); static int castToIntNoException(Object value); static long castToLongNoException(Object value); static double castToDoubleNoException(Object value); }
MathUtils { public static int parseInt(String numberString) { try { return Integer.parseInt(numberString); } catch (NumberFormatException ex) { return 0; } }  static boolean isNumber(String numberString); static boolean isInteger(String numberString); static boolean isLong(String numberString); static int parseInt(String numberString); static long parseLong(String numberString); static double round(double sourceNum, int scale); static int castToInt(Object value); static long castToLong(Object value); static double castToDouble(Object value); static int castToIntNoException(Object value); static long castToLongNoException(Object value); static double castToDoubleNoException(Object value);  }