Java Short Number Create toShort(Object value)

Here you can find the source of toShort(Object value)

Description

to Short

License

Open Source License

Declaration

public static long toShort(Object value) 

Method Source Code

//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();
    }
}

Related

  1. toShort(Object prmIntObject)
  2. toShort(Object value)
  3. toShort(Object value)
  4. toShort(Object value)
  5. toShort(Object value)
  6. toShort(String input, short defaultValue)
  7. toShort(String numeric)
  8. toShort(String str)
  9. toShort(String str)