@Test public void testConfigParseListWithEmptyValue() throws Exception { assertParsedList(Arrays.asList("")); assertEquals(KeyValueParser.parseList("\"\""), Arrays.asList("")); }
public static List<String> parseList(String line) { List<String> result = new ArrayList<String>(); QuotedStringTokenizer tokenizer = new QuotedStringTokenizer(line, null, true, ",", false); while (tokenizer.hasMoreTokens()) { result.add(tokenizer.unquoteToken(tokenizer.nextToken().trim())); } return result; }
KeyValueParser { public static List<String> parseList(String line) { List<String> result = new ArrayList<String>(); QuotedStringTokenizer tokenizer = new QuotedStringTokenizer(line, null, true, ",", false); while (tokenizer.hasMoreTokens()) { result.add(tokenizer.unquoteToken(tokenizer.nextToken().trim())); } return result; } }
KeyValueParser { public static List<String> parseList(String line) { List<String> result = new ArrayList<String>(); QuotedStringTokenizer tokenizer = new QuotedStringTokenizer(line, null, true, ",", false); while (tokenizer.hasMoreTokens()) { result.add(tokenizer.unquoteToken(tokenizer.nextToken().trim())); } return result; }  }
KeyValueParser { public static List<String> parseList(String line) { List<String> result = new ArrayList<String>(); QuotedStringTokenizer tokenizer = new QuotedStringTokenizer(line, null, true, ",", false); while (tokenizer.hasMoreTokens()) { result.add(tokenizer.unquoteToken(tokenizer.nextToken().trim())); } return result; }  static String toLine(Map<String, String> parts); static String toLine(Collection<String> parts); static List<String> parseList(String line); @Deprecated // use parseMap static Map<String,String> parse(String line); static Map<String,String> parseMap(String line); }
KeyValueParser { public static List<String> parseList(String line) { List<String> result = new ArrayList<String>(); QuotedStringTokenizer tokenizer = new QuotedStringTokenizer(line, null, true, ",", false); while (tokenizer.hasMoreTokens()) { result.add(tokenizer.unquoteToken(tokenizer.nextToken().trim())); } return result; }  static String toLine(Map<String, String> parts); static String toLine(Collection<String> parts); static List<String> parseList(String line); @Deprecated // use parseMap static Map<String,String> parse(String line); static Map<String,String> parseMap(String line);  }