Here you can find the source of toLongValue(Object value)
public static Long toLongValue(Object value)
//package com.java2s; // The MIT License (MIT) public class Main { public static Long toLongValue(Object value) { if ((value == null) || (value.getClass() == Long.class)) { return (Long) value; }/*from w ww .ja v a 2 s . com*/ if (value instanceof Number) { return ((Number) value).longValue(); } throw new IllegalArgumentException( "value must be instance of Number."); } }