Java tutorial
//package com.java2s; //License from project: Apache License public class Main { private static Long transformToLong(String v) { if (v != null) { try { return Long.valueOf(v); } catch (NumberFormatException e) { return 0L; } } else { return 0L; } } }