@Test public void getLongValue_FirstIsUsed() { kv.add("foo", "bogus_number"); kv.add("toto", "2"); assertEquals(new Long(0), KVUtils.getLongValue(kv, 0L, "foo", "toto")); }
public static Long getLongValue(KVPairs kv, Long defaultValue, String... keys) { String v = findFirstNonNullValue(kv, keys); try { return v == null ? defaultValue : Long.parseLong(v); } catch (Exception e) { return defaultValue; } }
KVUtils { public static Long getLongValue(KVPairs kv, Long defaultValue, String... keys) { String v = findFirstNonNullValue(kv, keys); try { return v == null ? defaultValue : Long.parseLong(v); } catch (Exception e) { return defaultValue; } } }
KVUtils { public static Long getLongValue(KVPairs kv, Long defaultValue, String... keys) { String v = findFirstNonNullValue(kv, keys); try { return v == null ? defaultValue : Long.parseLong(v); } catch (Exception e) { return defaultValue; } }  }
KVUtils { public static Long getLongValue(KVPairs kv, Long defaultValue, String... keys) { String v = findFirstNonNullValue(kv, keys); try { return v == null ? defaultValue : Long.parseLong(v); } catch (Exception e) { return defaultValue; } }  static String getValue(KVPairs kv, String defaultValue, String... keys); static Long getLongValue(KVPairs kv, Long defaultValue, String... keys); static boolean getBooleanValue(KVPairs kv, boolean defaultValue, String... keys); static Optional<String> getValueOpt(KVPairs kv, String key); }
KVUtils { public static Long getLongValue(KVPairs kv, Long defaultValue, String... keys) { String v = findFirstNonNullValue(kv, keys); try { return v == null ? defaultValue : Long.parseLong(v); } catch (Exception e) { return defaultValue; } }  static String getValue(KVPairs kv, String defaultValue, String... keys); static Long getLongValue(KVPairs kv, Long defaultValue, String... keys); static boolean getBooleanValue(KVPairs kv, boolean defaultValue, String... keys); static Optional<String> getValueOpt(KVPairs kv, String key);  }