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;
        }
    }
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;
        }
    }
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.

@param o The object to attempt to cast
@return The object as a short
Casts a value to a short . May return null .