public static HTraceConfiguration fromKeyValuePairs(String... pairs) { if ((pairs.length % 2) != 0) { throw new RuntimeException("You must specify an equal number of keys " + "and values."); } Map<String, String> conf = new HashMap<String, String>(); for (int i = 0; i < pairs.length; i+=2) { conf.put(pairs[i], pairs[i + 1]); } return new MapConf(conf); }
@Override public String get(String key, String defaultValue) { String value = get(key); return value == null ? defaultValue : value; } }
public static HTraceConfiguration fromKeyValuePairs(String... pairs) { if ((pairs.length % 2) != 0) { throw new RuntimeException("You must specify an equal number of keys " + "and values."); } Map<String, String> conf = new HashMap<String, String>(); for (int i = 0; i < pairs.length; i+=2) { conf.put(pairs[i], pairs[i + 1]); } return new MapConf(conf); }
/** * Create an HTrace configuration from a map. * * @param conf The map to create the configuration from. * @return The new configuration. */ public static HTraceConfiguration fromMap(Map<String, String> conf) { return new MapConf(conf); }
@Override public String get(String key, String defaultValue) { String value = get(key); return value == null ? defaultValue : value; } }
@Override public String get(String key, String defaultValue) { String value = get(key); return value == null ? defaultValue : value; } }
public static HTraceConfiguration fromKeyValuePairs(String... pairs) { if ((pairs.length % 2) != 0) { throw new RuntimeException("You must specify an equal number of keys " + "and values."); } Map<String, String> conf = new HashMap<String, String>(); for (int i = 0; i < pairs.length; i+=2) { conf.put(pairs[i], pairs[i + 1]); } return new MapConf(conf); }
/** * Create an HTrace configuration from a map. * * @param conf The map to create the configuration from. * @return The new configuration. */ public static HTraceConfiguration fromMap(Map<String, String> conf) { return new MapConf(conf); }
/** * Create an HTrace configuration from a map. * * @param conf The map to create the configuration from. * @return The new configuration. */ public static HTraceConfiguration fromMap(Map<String, String> conf) { return new MapConf(conf); }