public class KeyValueParser
extends java.lang.Object
Splitter.withKeyValueSeparator(char)
, but that doesn't give the
same behaviour for values, see QuotedStringTokenizer
. For example:
String val = "a=x,b=y";
Map<String,String> map = Splitter.on(",").withKeyValueSeparator("=").split(val);
Constructor and Description |
---|
KeyValueParser() |
Modifier and Type | Method and Description |
---|---|
static java.util.Map<java.lang.String,java.lang.String> |
parse(java.lang.String line)
Deprecated.
|
static java.util.List<java.lang.String> |
parseList(java.lang.String line) |
static java.util.Map<java.lang.String,java.lang.String> |
parseMap(java.lang.String line)
takes a string of the form "key=value,key2=value2" and returns a map;
values can be quoted (but not keys)
|
static java.lang.String |
toLine(java.util.Collection<java.lang.String> parts) |
static java.lang.String |
toLine(java.util.Map<java.lang.String,java.lang.String> parts) |
public static java.lang.String toLine(java.util.Map<java.lang.String,java.lang.String> parts)
public static java.lang.String toLine(java.util.Collection<java.lang.String> parts)
public static java.util.List<java.lang.String> parseList(java.lang.String line)
@Deprecated public static java.util.Map<java.lang.String,java.lang.String> parse(java.lang.String line)
public static java.util.Map<java.lang.String,java.lang.String> parseMap(java.lang.String line)