Here you can find the source of toShort(Object value)
public static long toShort(Object value)
//package com.java2s; //License from project: Open Source License public class Main { public static long toShort(Object value) { return (value == null || "null".equals(value.toString())) ? 0 : Short.parseShort(value.toString().trim()); }/*from www .j a v a 2s . c om*/ public static String toString(Object value) { return value == null || "null".equals(value.toString()) ? "" : value.toString(); } }