public Integer asIntegerObj ( ) { if ( current == null ) return null ; if ( current instanceof Number ) { if ( current instanceof Integer ) return ( Integer ) current ; if ( current instanceof Long ) { Long l = ( Long ) current ; if ( l . longValue ( ) == l . intValue ( ) ) { return Integer . valueOf ( l . intValue ( ) ) ; } } return null ; } return null ; }
get the current object value as Integer if the current Object can not be cast as Integer return null .