Here you can find the source of castToLong(final String uid)
public static Long castToLong(final String uid)
//package com.java2s; //License from project: Open Source License public class Main { public static Long castToLong(final String uid) { try {/*from w w w . ja v a2 s . co m*/ return Long.decode(uid); } catch (NumberFormatException nfe) { return null; } } }