|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.google.common.base.Splitter.MapSplitter
@Beta public static final class Splitter.MapSplitter
An object that splits strings into maps as Splitter
splits
iterables and lists. Like Splitter
, it is thread-safe and
immutable.
Method Summary | |
---|---|
java.util.Map<java.lang.String,java.lang.String> |
split(java.lang.CharSequence sequence)
Splits sequence into substrings, splits each substring into
an entry, and returns an unmodifiable map with each of the entries. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
---|
public java.util.Map<java.lang.String,java.lang.String> split(java.lang.CharSequence sequence)
sequence
into substrings, splits each substring into
an entry, and returns an unmodifiable map with each of the entries. For
example,
Splitter.on(';').trimResults().withKeyValueSeparator("=>")
.split("a=>b ; c=>b")
will return a mapping from "a"
to "b"
and
"c"
to b
.
The returned map preserves the order of the entries from
sequence
.
java.lang.IllegalArgumentException
- if the specified sequence does not split
into valid map entries, or if there are duplicate keys
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |