@Test public void getValue() { kv.add("foo", "bar"); kv.add("toto", "tata"); assertEquals("primary key", "bar", KVUtils.getValue(kv, "default", "foo", "toto")); assertEquals("secondary key", "tata", KVUtils.getValue(kv, "default", "bogus", "toto")); assertEquals("default value", "default", KVUtils.getValue(kv, "default", "bogus", "bogus_too")); }
public static String getValue(KVPairs kv, String defaultValue, String... keys) { String v = findFirstNonNullValue(kv, keys); return v == null ? defaultValue : v; }
KVUtils { public static String getValue(KVPairs kv, String defaultValue, String... keys) { String v = findFirstNonNullValue(kv, keys); return v == null ? defaultValue : v; } }
KVUtils { public static String getValue(KVPairs kv, String defaultValue, String... keys) { String v = findFirstNonNullValue(kv, keys); return v == null ? defaultValue : v; }  }
KVUtils { public static String getValue(KVPairs kv, String defaultValue, String... keys) { String v = findFirstNonNullValue(kv, keys); return v == null ? defaultValue : v; }  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 String getValue(KVPairs kv, String defaultValue, String... keys) { String v = findFirstNonNullValue(kv, keys); return v == null ? defaultValue : v; }  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);  }