Here you can find the source of toLong(Object objValue)
Parameter | Description |
---|---|
objValue | Object |
public static long toLong(Object objValue)
//package com.java2s; /*//from w ww .j a v a 2 s. c o m * Copyright 2005-2020 GreenTube Team All rights reserved. * Support: Huxg * License: CND team license */ public class Main { /** * * * @param objValue Object * * @return long */ public static long toLong(Object objValue) { if (objValue != null) { if (objValue instanceof Number) { return ((Number) objValue).longValue(); } else { return Long.parseLong(objValue.toString()); } } else return 0; } /** * * * @param objValue Object * * @return String */ public static String toString(Object objValue) { if (objValue != null) return objValue.toString(); else return null; } }