public static long getLong(Map<String, String> settings, String name, long defaultValue) throws IllegalArgumentException {
        if (settings.containsKey(name)) {

            String value = settings.get(name);
            try {
                return Long.parseLong(value);
            } catch (Exception e) {
                throw new IllegalArgumentException("Setting '" + name + "=" + value + "' is not a long on " + settings);
            }
        } else {
            return defaultValue;
        }
    }
public static long getLong(Map<String, String> settings, String name, long defaultValue) throws IllegalArgumentException {
        if (settings.containsKey(name)) {

            String value = settings.get(name);
            try {
                return Long.parseLong(value);
            } catch (Exception e) {
                throw new IllegalArgumentException("Setting '" + name + "=" + value + "' is not a long on " + settings);
            }
        } else {
            return defaultValue;
        }
    }
public static long getLong ( Map < String , String > settings , String name , long defaultValue ) throws IllegalArgumentException { if ( settings . containsKey ( name ) ) { String value = settings . get ( name ) ; try { return Long . parseLong ( value ) ; } catch ( Exception e ) { throw new IllegalArgumentException ( "Setting '" + name + "=" + value + "' is not a long on " + settings ) ; } } else { return defaultValue ; } }
Convert value of this setting to a Java <b>long</b>.

If the property is not found, the <code>defaultValue</code> is returned. If the property is not a long, an exception is thrown.

@param name         name of the property
@param defaultValue default value if the property is not defined.
@return int value of the property or <code>defaultValue</code> if the property is not defined.
@throws IllegalArgumentException if setting is not is not a long.
Convert value of this setting to a Java <b > long< / b > .