Java Long Number Create toLong(Object value)

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

Description

to Long

License

Apache License

Declaration

public static Long toLong(Object value) 

Method Source Code

//package com.java2s;
//License from project: Apache License 

public class Main {
    /** EMPTY [String] */
    public static final String EMPTY = "";

    public static Long toLong(Object value) {

        try {// w  w w.  ja v a  2  s.c  o  m
            if (value == null || EMPTY.equals(value)) {
                return null;
            }
            return Long.valueOf(value.toString());
        } catch (Exception e) {
            e.printStackTrace();
            return null;
        }

    }
}

Related

  1. toLong(Object value)
  2. toLong(Object value)
  3. toLong(Object value)
  4. toLong(Object value)
  5. toLong(Object value)
  6. toLong(Object value)
  7. toLong(Object value)
  8. toLong(Object value, long defaultValue)
  9. toLong(Object x)