Here you can find the source of toShort(Object value)
public static Short toShort(Object value)
//package com.java2s; //License from project: Open Source License public class Main { /** EMPTY [String] */ public static final String EMPTY = ""; public static Short toShort(Object value) { try {//from ww w .ja v a 2 s . c o m if (value == null || EMPTY.equals(value)) { return null; } return Short.valueOf(value.toString()); } catch (Exception e) { e.printStackTrace(); return null; } } }