Here you can find the source of tryParseInteger(String text)
public static int tryParseInteger(String text)
//package com.java2s; //License from project: Apache License public class Main { public static int tryParseInteger(String text) { if ("".equals(text)) return -1; try {/* ww w.ja va2 s .co m*/ return Integer.parseInt(text); } catch (NumberFormatException e) { return -1; } } }