@Test public void getLongDefaultValueWithPropertyNull() { assertEquals(1, SystemPropertyUtil.getLong("key", 1)); }
public static long getLong(String key, long def) { String value = get(key); if (value == null) { return def; } value = value.trim(); try { return Long.parseLong(value); } catch (Exception e) { } logger.warn( "Unable to parse the long integer system property '{}':{} - using the default value: {}", key, value, def ); return def; }
SystemPropertyUtil { public static long getLong(String key, long def) { String value = get(key); if (value == null) { return def; } value = value.trim(); try { return Long.parseLong(value); } catch (Exception e) { } logger.warn( "Unable to parse the long integer system property '{}':{} - using the default value: {}", key, value, def ); return def; } }
SystemPropertyUtil { public static long getLong(String key, long def) { String value = get(key); if (value == null) { return def; } value = value.trim(); try { return Long.parseLong(value); } catch (Exception e) { } logger.warn( "Unable to parse the long integer system property '{}':{} - using the default value: {}", key, value, def ); return def; } private  SystemPropertyUtil(); }
SystemPropertyUtil { public static long getLong(String key, long def) { String value = get(key); if (value == null) { return def; } value = value.trim(); try { return Long.parseLong(value); } catch (Exception e) { } logger.warn( "Unable to parse the long integer system property '{}':{} - using the default value: {}", key, value, def ); return def; } private  SystemPropertyUtil(); static boolean contains(String key); static String get(String key); static String get(final String key, String def); static boolean getBoolean(String key, boolean def); static int getInt(String key, int def); static long getLong(String key, long def); }
SystemPropertyUtil { public static long getLong(String key, long def) { String value = get(key); if (value == null) { return def; } value = value.trim(); try { return Long.parseLong(value); } catch (Exception e) { } logger.warn( "Unable to parse the long integer system property '{}':{} - using the default value: {}", key, value, def ); return def; } private  SystemPropertyUtil(); static boolean contains(String key); static String get(String key); static String get(final String key, String def); static boolean getBoolean(String key, boolean def); static int getInt(String key, int def); static long getLong(String key, long def);  }