Class MultimapJoiner
- java.lang.Object
-
- org.eclipse.xtext.xbase.typesystem.util.MultimapJoiner
-
public class MultimapJoiner extends java.lang.Object
An object that joins multimaps in the same manner asJoiner
joins iterables and arrays. LikeJoiner
, it is thread-safe and immutable.In contrast to using a
Joiner.MapJoiner
in conjunction withMultimap
, theMultimapJoiner
allows to use a custom joiner for the values of an entry.
-
-
Constructor Summary
Constructors Constructor Description MultimapJoiner(com.google.common.base.Joiner entryJoiner, java.lang.String separator, java.lang.String keyValueSeparator)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description <A extends java.lang.Appendable>
AappendTo(A appendable, com.google.common.collect.Multimap<?,?> map)
Appends the string representation of each entry ofmap
, using the previously configured separator and key-value separator, toappendable
.<A extends java.lang.Appendable>
AappendTo(A appendable, java.lang.Iterable<? extends java.util.Map.Entry<?,? extends java.util.Collection<?>>> entries)
Appends the string representation of each entry inentries
, using the previously configured separator and key-value separator, toappendable
.<A extends java.lang.Appendable>
AappendTo(A appendable, java.util.Map<?,? extends java.util.Collection<?>> map)
Appends the string representation of each entry ofmap
, using the previously configured separator and key-value separator, toappendable
.java.lang.StringBuilder
appendTo(java.lang.StringBuilder builder, com.google.common.collect.Multimap<?,?> map)
Appends the string representation of each entry ofmap
, using the previously configured separator and key-value separator, tobuilder
.java.lang.StringBuilder
appendTo(java.lang.StringBuilder builder, java.lang.Iterable<? extends java.util.Map.Entry<?,? extends java.util.Collection<?>>> entries)
Appends the string representation of each entry inentries
, using the previously configured separator and key-value separator, tobuilder
.java.lang.StringBuilder
appendTo(java.lang.StringBuilder builder, java.util.Map<?,? extends java.util.Collection<?>> map)
Appends the string representation of each entry ofmap
, using the previously configured separator and key-value separator, tobuilder
.java.lang.String
join(com.google.common.collect.Multimap<?,?> map)
Returns a string containing the string representation of each entry ofmap
, using the previously configured separator and key-value separator.java.lang.String
join(java.lang.Iterable<? extends java.util.Map.Entry<?,? extends java.util.Collection<?>>> entries)
Returns a string containing the string representation of each entry inentries
, using the previously configured separator and key-value separator.MultimapJoiner
skipNulls()
protected java.lang.CharSequence
toString(java.lang.Object part)
MultimapJoiner
useForNull(java.lang.String nullText)
Returns a multimap joiner with the same behavior as this one, except automatically substitutingnullText
for any provided null keys or values.
-
-
-
Method Detail
-
appendTo
public <A extends java.lang.Appendable> A appendTo(A appendable, com.google.common.collect.Multimap<?,?> map) throws java.io.IOException
Appends the string representation of each entry ofmap
, using the previously configured separator and key-value separator, toappendable
.- Throws:
java.io.IOException
-
appendTo
public <A extends java.lang.Appendable> A appendTo(A appendable, java.util.Map<?,? extends java.util.Collection<?>> map) throws java.io.IOException
Appends the string representation of each entry ofmap
, using the previously configured separator and key-value separator, toappendable
.- Throws:
java.io.IOException
-
appendTo
public java.lang.StringBuilder appendTo(java.lang.StringBuilder builder, com.google.common.collect.Multimap<?,?> map)
Appends the string representation of each entry ofmap
, using the previously configured separator and key-value separator, tobuilder
. Identical toappendTo(Appendable, Multimap)
, except that it does not throwIOException
.
-
appendTo
public java.lang.StringBuilder appendTo(java.lang.StringBuilder builder, java.util.Map<?,? extends java.util.Collection<?>> map)
Appends the string representation of each entry ofmap
, using the previously configured separator and key-value separator, tobuilder
. Identical toappendTo(Appendable, Map)
, except that it does not throwIOException
.
-
join
public java.lang.String join(com.google.common.collect.Multimap<?,?> map)
Returns a string containing the string representation of each entry ofmap
, using the previously configured separator and key-value separator.
-
appendTo
public <A extends java.lang.Appendable> A appendTo(A appendable, java.lang.Iterable<? extends java.util.Map.Entry<?,? extends java.util.Collection<?>>> entries) throws java.io.IOException
Appends the string representation of each entry inentries
, using the previously configured separator and key-value separator, toappendable
.- Throws:
java.io.IOException
-
appendTo
public java.lang.StringBuilder appendTo(java.lang.StringBuilder builder, java.lang.Iterable<? extends java.util.Map.Entry<?,? extends java.util.Collection<?>>> entries)
Appends the string representation of each entry inentries
, using the previously configured separator and key-value separator, tobuilder
. Identical toappendTo(Appendable, Iterable)
, except that it does not throwIOException
.
-
join
public java.lang.String join(java.lang.Iterable<? extends java.util.Map.Entry<?,? extends java.util.Collection<?>>> entries)
Returns a string containing the string representation of each entry inentries
, using the previously configured separator and key-value separator.
-
toString
protected java.lang.CharSequence toString(java.lang.Object part)
-
skipNulls
public MultimapJoiner skipNulls()
-
useForNull
public MultimapJoiner useForNull(java.lang.String nullText)
Returns a multimap joiner with the same behavior as this one, except automatically substitutingnullText
for any provided null keys or values.
-
-