Here you can find the source of toInt(Object objValue)
Parameter | Description |
---|---|
objValue | Object |
public static int toInt(Object objValue)
//package com.java2s; /*// w w w.j av a 2 s .co m * Copyright 2005-2020 GreenTube Team All rights reserved. * Support: Huxg * License: CND team license */ public class Main { /** * * * @param objValue Object * * @return int */ public static int toInt(Object objValue) { if (objValue != null) { if (objValue instanceof Number) { return ((Number) objValue).intValue(); } else { return Integer.parseInt(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; } }