Java Long Number Create ToLong(String s)

Here you can find the source of ToLong(String s)

Description

To Long

License

Apache License

Declaration

public static final Long ToLong(String s) 

Method Source Code

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

public class Main {
    public static final Long ToLong(String s) {

        if (ToString(s).isEmpty()) {
            return null;
        }/*from  ww  w .j  a  va 2 s. c  o  m*/

        return Long.parseLong(ToString(s));
    }

    public static final Long ToLong(Object o) {
        return ToLong(ToString(o));
    }

    public static final String ToString(Object o) {
        return o != null ? o.toString() : "";
    }

    public static final String ToString(String s) {
        return s != null ? s : "";
    }
}

Related

  1. toLong(String s)
  2. toLong(String s)
  3. toLong(String s)
  4. toLong(String s)
  5. toLong(String s)
  6. toLong(String s, long defValue)
  7. toLong(String src)
  8. toLong(String str)
  9. toLong(String str)