Here you can find the source of castToInteger(Object object)
Parameter | Description |
---|---|
object | a parameter |
public static Integer castToInteger(Object object)
//package com.java2s; /*//w w w . j av a 2 s . c o m Pulsar Copyright (C) 2013-2015 eBay Software Foundation Licensed under the GPL v2 license. See LICENSE for full terms. */ public class Main { /** * Sometimes ELP's version of cast is misbehaving * * @param object * @return */ public static Integer castToInteger(Object object) { if (object != null) { if (object instanceof Integer) return (Integer) object; else return Integer.valueOf(object.toString()); } return null; } }