示例#1
0
文件: MapValue.java 项目: robig/stlab
 public void load() {
   log.debug("requesting config keys for " + prefix);
   Set<String> nameKeys =
       ObjectConfig.getInstance().filterProperties(prefix + ".names").stringPropertyNames();
   for (String key : nameKeys) {
     log.debug("key: " + key);
     String keyBase = key.replace(prefix + ".names", "");
     String name = ObjectConfig.getInstance().getValue(key, "");
     log.debug("Requesting value for key: " + prefix + ".values" + keyBase);
     StringValue value = ObjectConfig.getStringValue(prefix + ".values" + keyBase, "");
     if (value != null && !value.equals("")) {
       map.put(name, value);
     }
   }
 }
示例#2
0
文件: MapValue.java 项目: robig/stlab
 /** remove a key-value pair by key */
 public void remove(String name) {
   StringValue v = get(name);
   if (v != null) {
     log.debug("Removing name: " + name);
     map.remove(name);
     ObjectConfig.remove(v.key);
     ObjectConfig.remove(v.key.replace(".values.", ".names."));
   }
 }