Here you can find the source of castInt(Object o)
Parameter | Description |
---|---|
o | Object to cast. |
public static Integer castInt(Object o)
//package com.java2s; //License from project: Open Source License public class Main { /**/* w w w .ja v a2 s . c o m*/ * Casts the given object to an integer if applicable. * @param o Object to cast. * @return The resulting integer. */ public static Integer castInt(Object o) { if (o instanceof Number) { return ((Number) o).intValue(); } return null; } }