Java Long Number From toLongValue(Object value)

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

Description

to Long Value

License

Open Source License

Declaration

public static Long toLongValue(Object value) 

Method Source Code

//package com.java2s;
// The MIT License (MIT)

public class Main {
    public static Long toLongValue(Object value) {
        if ((value == null) || (value.getClass() == Long.class)) {
            return (Long) value;
        }/*from  w  ww  .ja v a 2 s  . com*/
        if (value instanceof Number) {
            return ((Number) value).longValue();
        }
        throw new IllegalArgumentException(
                "value must be instance of Number.");
    }
}

Related

  1. toLongTimestamp(Object cell)
  2. toLongUnsigned(int intValue)
  3. toLongValue(byte... bytes)
  4. toLongValue(final Object o)
  5. toLongValue(final String candidateString)