Java Long Number Create toLong(Object value)

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

Description

to Long

License

Open Source License

Declaration

public static final long toLong(Object value) 

Method Source Code

//package com.java2s;

public class Main {
    public static final long toLong(Object value) {
        if (value instanceof Number)
            return ((Number) value).longValue();
        else if (value == null)
            return 0;
        else// ww w  . j  a  v  a  2  s . c  o m
            return Long.parseLong(value.toString());
    }

    public static final String toString(Object value) {
        if (value == null)
            return null;

        return value.toString();
    }
}

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, long defaultValue)
  8. toLong(Object x)
  9. toLong(short[] arr)