Class MultimapJoiner
- java.lang.Object
-
- org.eclipse.xtext.xbase.typesystem.util.MultimapJoiner
-
public class MultimapJoiner extends java.lang.ObjectAn object that joins multimaps in the same manner asJoinerjoins iterables and arrays. LikeJoiner, it is thread-safe and immutable.In contrast to using a
Joiner.MapJoinerin conjunction withMultimap, theMultimapJoinerallows 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.StringBuilderappendTo(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.StringBuilderappendTo(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.StringBuilderappendTo(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.Stringjoin(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.Stringjoin(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.MultimapJoinerskipNulls()protected java.lang.CharSequencetoString(java.lang.Object part)MultimapJoineruseForNull(java.lang.String nullText)Returns a multimap joiner with the same behavior as this one, except automatically substitutingnullTextfor 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.IOExceptionAppends 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.IOExceptionAppends 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.IOExceptionAppends 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 substitutingnullTextfor any provided null keys or values.
-
-