Here you can find the source of toLong(Number num)
Parameter | Description |
---|---|
num | A Number instance. |
public static Long toLong(Number num)
//package com.java2s; /*/*from w ww . j a v a2 s . co m*/ * Copyright (c) 2015 NEC Corporation * All rights reserved. * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License v1.0 which accompanies this * distribution, and is available at http://www.eclipse.org/legal/epl-v10.html */ public class Main { /** * Convert the given number into a {@link Long} instance. * * @param num A {@link Number} instance. * @return A {@link Long} instance equivalent to the given number. * {@code null} if {@code num} is {@code null}. */ public static Long toLong(Number num) { return (num == null) ? null : Long.valueOf(num.longValue()); } }