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 Short toShort(Object value) 

Method Source Code

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

    }
}

Related

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