Here you can find the source of toLong(Object obj)
Parameter | Description |
---|---|
obj | the object to be converted |
public static long toLong(Object obj)
//package com.java2s; public class Main { /**//from www .j a va 2 s. c o m * Get the long value of this object, only if the object is an instance of Number * * @param obj the object to be converted * @return the long value of the object, or 0L if it is not a number. */ public static long toLong(Object obj) { return (obj instanceof Number) ? ((Number) obj).longValue() : 0L; } }