Java Long Number Create toLong(Object object)

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

Description

to Long

License

Apache License

Declaration

public static long toLong(Object object) 

Method Source Code

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

public class Main {
    public static long toLong(Object object) {
        return object instanceof Number ? ((Number) object).longValue() : Long.parseLong(object.toString());
    }//w  w w .j  a  va 2  s  .  c  o  m

    public static String toString(Object object) {
        return object == null ? null : object.toString();
    }
}

Related

  1. toLong(Object obj)
  2. toLong(Object obj)
  3. toLong(Object obj, String pattern)
  4. toLong(Object object)
  5. toLong(Object object)
  6. toLong(Object object)
  7. toLong(Object object, long defaultValue)
  8. toLong(Object object, Long defaultValue)
  9. toLong(Object objectToConvert)