Here you can find the source of toInt(String value, Integer fallback)
public static Integer toInt(String value, Integer fallback)
//package com.java2s; //License from project: Open Source License public class Main { public static Integer toInt(String value, Integer fallback) { if (value == null || value.isEmpty()) { return fallback; }/*from w w w. j ava 2 s . c o m*/ try { return Integer.valueOf(value); } catch (Exception e) { return fallback; } } }