Returns the Long represented by the given value, or null if not an long value.
771263
private static Object toLong( BigDecimal value)
    {
    Object number;
        
    try
      {
      number =
        value.scale() == 0
        ? Long.valueOf( value.longValueExact())
        : null;
      }
    catch( Exception e)
      {
      number = null;
      }
        
    return number;
    }
623143
public Long getAsNullableLong(String key) {
		Object value = getAsObject(key);
		return LongConverter.toNullableLong(value);
	}
728638
public static long fromBytes(byte[] value){
        if (value == null) return 0;
        long out = 0;
        int length = value.length;
        if (length > 8) length = 8;
        for (int i = 0; i < length; i++){
            out = (out << 8) + (value[i] & 0xff);
        }
        return out;
    }
94665
public long getLong(String columnName, long defaultValue) {
        int index = getColumnIndex(columnName);
        if (isValidIndex(index)) {
            return getLong(index);
        } else {
            return defaultValue;
        }
    }
1082974
public Long toLong() {
		Long value;
		value = Long.valueOf(this.isNeg ? Long.parseLong(this.param)*-1 : Long.parseLong(this.param));
		return value;
	}
1052958
public Long getLong(String key, Long defaultValue) {
        Object o = get(key);
        if (o != null) {
            if (o instanceof Long) {
                return (Long) o;
            } else if (o instanceof Integer) {
                return new Long((Integer)o);
            }
        }
        return defaultValue;
    }
720280
public long getLong(String key) throws LazyException{
		LazyNode token=getFieldToken(key);
		return token.getLongValue();
	}
1055841
public static long longFromBase64(String value) {
        int pos = 0;
        long longVal = base64Values[value.charAt(pos++)];
        int len = value.length();
        while (pos < len) {
            longVal <<= 6;
            longVal |= base64Values[value.charAt(pos++)];
        }
        return longVal;
    }
252219
@Override
    public final long optLong(final String key, final long defaultValue) {
        Long result = optLong(key);
        return result == null ? defaultValue : result;
    }
734798
public static Long readLong(String value, Long defaultValue) {
		if (!StringUtils.hasText(value)) return defaultValue;
		
		return Long.valueOf(value);
	}
335449
public Long asLongObj() {
		if (current == null)
			return null;
		if (current instanceof Number) {
			if (current instanceof Long)
				return (Long) current;
			if (current instanceof Integer)
				return Long.valueOf(((Number) current).longValue());
			return null;
		}
		return null;
	}
300444
public static long asLong(Object value) {
        if (value instanceof Number) {
            return ((Number) value).longValue();
        } else if (value instanceof Numeric) {
            return ((Numeric) value).asInteger();
        } else if (value instanceof Boolean) {
            return ((Boolean) value) ? 1L : 0L;
        } else if (value instanceof CharSequence) {
            try {
                return Long.parseLong(value.toString());
            } catch (NumberFormatException nfe) {
                throw new IncompatibleValueException("Unable to parse string \"" + Strings.escape(value.toString()) +
                                                     "\" to a long", nfe);
            }
        } else if (value instanceof Date) {
            // Return date timestamp.
            return ((Date) value).getTime();
        }
        throw new IncompatibleValueException("Unable to convert " + value.getClass().getSimpleName() + " to a long");

    }
1030556
public static Long toLong(Object o, Long defaultValue) {
	if (o instanceof Long) return (Long) o;
	if (defaultValue != null) return Long.valueOf(toLongValue(o, defaultValue.longValue()));

	long res = toLongValue(o, Long.MIN_VALUE);
	if (res == Long.MIN_VALUE) return defaultValue;
	return Long.valueOf(res);
    }
210146
public long getLong(int index, long otherwise) {
        Long l = getLong(index);
        return l == null ? otherwise : l;
    }
564995
public static Long getLongProperty(String property) {
        if (property == null) {
            return null;
        }
        Long propertyLong = null;
        try {
            propertyLong = Long.valueOf(property);
        } catch (NumberFormatException e) {
            LOG.warn("Cannot convert string value into number", e);
        }
        return propertyLong;
    }
603919
public long getLong(String key, long defaultValue) {
    Object value = get(key);
    if (value instanceof Long) {
      return (long) value;
    }
    if (value instanceof Number) {
      return ((Number) value).longValue();
    } else if (value instanceof String) {
      try {
        return Long.valueOf((String) value);
      } catch (NumberFormatException ignored) {
      }
    }
    return defaultValue;
  }
586446
@SuppressWarnings ("WeakerAccess")
    public Long getLong (int index) {
        String string = getString (index);
        return (string != null) ? Long.parseLong (string) : null;
    }