/** * Set a value that is known to be a list. The value can be retrieved using this{@link #getPropertyStringList(String)} * <br> * Within the file, the value is stored as a single Comma Separated Value */ public void setPropertyStringList(String key, List<String> value) { setProperty(key, toListText(value)); }
c.setProperty("list", "a,b,c"); assertEquals("There should be 3 items in the list",3,c.getPropertyStringList("list").size()); assertEquals("Item 1 should be a","a",c.getPropertyStringList("list").get(0));
c.setProperty("list", "a,b,c"); assertEquals("There should be 3 items in the list",3,c.getPropertyStringList("list").size()); assertEquals("Item 1 should be a","a",c.getPropertyStringList("list").get(0));
public void setRegistryMap(SortedMap<String, Registry> registries) { registryMap.clear(); registryMap.putAll(registries); super.clear(); List<String> keyList = new ArrayList<String>(); for (Entry<String, Registry> entry : registryMap.entrySet()) { final String key = entry.getKey(); keyList.add (key); super.setProperty(key, entry.getValue() .getRegistryBaseString()); } Collections.sort(keyList); String registryNamesConcatenated = StringUtils.join(keyList, ","); super.setProperty(REGISTRY_LIST, registryNamesConcatenated); }