Package com.google.common.base
Class Joiner.MapJoiner
java.lang.Object
com.google.common.base.Joiner.MapJoiner
- Enclosing class:
Joiner
Deprecated.
The Google Guava Core Libraries are deprecated and will not be part of the AEM SDK after April 2023
An object that joins map entries in the same manner as
Joiner joins iterables and
arrays. Like Joiner, it is thread-safe and immutable.
In addition to operating on Map instances, MapJoiner can operate on
Multimap entries in two distinct modes:
- To output a separate entry for each key-value pair, pass
multimap.entries()to aMapJoinermethod that accepts entries as input, and receive output of the formkey1=A&key1=B&key2=C. - To output a single entry for each key, pass
multimap.asMap()to aMapJoinermethod that accepts a map as input, and receive output of the formkey1=[A, B]&key2=C.
- Since:
- 2.0 (imported from Google Collections Library)
-
Method Summary
Modifier and TypeMethodDescription<A extends Appendable>
ADeprecated.Appends the string representation of each entry inentries, using the previously configured separator and key-value separator, toappendable.<A extends Appendable>
ADeprecated.Appends the string representation of each entry inentries, using the previously configured separator and key-value separator, toappendable.<A extends Appendable>
ADeprecated.Appends the string representation of each entry ofmap, using the previously configured separator and key-value separator, toappendable.appendTo(StringBuilder builder, Iterable<? extends Map.Entry<?, ?>> entries) Deprecated.Appends the string representation of each entry inentries, using the previously configured separator and key-value separator, tobuilder.appendTo(StringBuilder builder, Iterator<? extends Map.Entry<?, ?>> entries) Deprecated.Appends the string representation of each entry inentries, using the previously configured separator and key-value separator, tobuilder.appendTo(StringBuilder builder, Map<?, ?> map) Deprecated.Appends the string representation of each entry ofmap, using the previously configured separator and key-value separator, tobuilder.Deprecated.Returns a string containing the string representation of each entry inentries, using the previously configured separator and key-value separator.Deprecated.Returns a string containing the string representation of each entry inentries, using the previously configured separator and key-value separator.Deprecated.Returns a string containing the string representation of each entry ofmap, using the previously configured separator and key-value separator.useForNull(String nullText) Deprecated.Returns a map joiner with the same behavior as this one, except automatically substitutingnullTextfor any provided null keys or values.
-
Method Details
-
appendTo
Deprecated.Appends the string representation of each entry ofmap, using the previously configured separator and key-value separator, toappendable.- Throws:
IOException
-
appendTo
Deprecated.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
Deprecated.Returns a string containing the string representation of each entry ofmap, using the previously configured separator and key-value separator. -
appendTo
@Beta public <A extends Appendable> A appendTo(A appendable, Iterable<? extends Map.Entry<?, ?>> entries) throws IOExceptionDeprecated.Appends the string representation of each entry inentries, using the previously configured separator and key-value separator, toappendable.- Throws:
IOException- Since:
- 10.0
-
appendTo
@Beta public <A extends Appendable> A appendTo(A appendable, Iterator<? extends Map.Entry<?, ?>> parts) throws IOExceptionDeprecated.Appends the string representation of each entry inentries, using the previously configured separator and key-value separator, toappendable.- Throws:
IOException- Since:
- 11.0
-
appendTo
@Beta public StringBuilder appendTo(StringBuilder builder, Iterable<? extends Map.Entry<?, ?>> entries) Deprecated.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.- Since:
- 10.0
-
appendTo
@Beta public StringBuilder appendTo(StringBuilder builder, Iterator<? extends Map.Entry<?, ?>> entries) Deprecated.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.- Since:
- 11.0
-
join
Deprecated.Returns a string containing the string representation of each entry inentries, using the previously configured separator and key-value separator.- Since:
- 10.0
-
join
Deprecated.Returns a string containing the string representation of each entry inentries, using the previously configured separator and key-value separator.- Since:
- 11.0
-
useForNull
Deprecated.Returns a map joiner with the same behavior as this one, except automatically substitutingnullTextfor any provided null keys or values.
-