public static Short castShort ( Object o ) { if ( o == null ) { return null ; } if ( o instanceof Number ) { return ( ( Number ) o ) . shortValue ( ) ; } try { return Short . valueOf ( o . toString ( ) ) ; } catch ( NumberFormatException e ) { return null ; } }
Casts a value to a short . May return null .