Class Joiner.MapJoiner

java.lang.Object
com.google.common.base.Joiner.MapJoiner
Enclosing class:
Joiner

@Deprecated(since="2022-12-01") public static final class Joiner.MapJoiner extends Object
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 a MapJoiner method that accepts entries as input, and receive output of the form key1=A&key1=B&key2=C.
  • To output a single entry for each key, pass multimap.asMap() to a MapJoiner method that accepts a map as input, and receive output of the form key1=[A, B]&key2=C.
Since:
2.0 (imported from Google Collections Library)
  • Method Summary

    Modifier and Type
    Method
    Description
    <A extends Appendable>
    A
    appendTo(A appendable, Iterable<? extends Map.Entry<?,?>> entries)
    Deprecated.
    Appends the string representation of each entry in entries, using the previously configured separator and key-value separator, to appendable.
    <A extends Appendable>
    A
    appendTo(A appendable, Iterator<? extends Map.Entry<?,?>> parts)
    Deprecated.
    Appends the string representation of each entry in entries, using the previously configured separator and key-value separator, to appendable.
    <A extends Appendable>
    A
    appendTo(A appendable, Map<?,?> map)
    Deprecated.
    Appends the string representation of each entry of map, using the previously configured separator and key-value separator, to appendable.
    appendTo(StringBuilder builder, Iterable<? extends Map.Entry<?,?>> entries)
    Deprecated.
    Appends the string representation of each entry in entries, using the previously configured separator and key-value separator, to builder.
    appendTo(StringBuilder builder, Iterator<? extends Map.Entry<?,?>> entries)
    Deprecated.
    Appends the string representation of each entry in entries, using the previously configured separator and key-value separator, to builder.
    appendTo(StringBuilder builder, Map<?,?> map)
    Deprecated.
    Appends the string representation of each entry of map, using the previously configured separator and key-value separator, to builder.
    join(Iterable<? extends Map.Entry<?,?>> entries)
    Deprecated.
    Returns a string containing the string representation of each entry in entries, using the previously configured separator and key-value separator.
    join(Iterator<? extends Map.Entry<?,?>> entries)
    Deprecated.
    Returns a string containing the string representation of each entry in entries, using the previously configured separator and key-value separator.
    join(Map<?,?> map)
    Deprecated.
    Returns a string containing the string representation of each entry of map, 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 substituting nullText for any provided null keys or values.

    Methods inherited from class java.lang.Object

    equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Method Details

    • appendTo

      public <A extends Appendable> A appendTo(A appendable, Map<?,?> map) throws IOException
      Deprecated.
      Appends the string representation of each entry of map, using the previously configured separator and key-value separator, to appendable.
      Throws:
      IOException
    • appendTo

      public StringBuilder appendTo(StringBuilder builder, Map<?,?> map)
      Deprecated.
      Appends the string representation of each entry of map, using the previously configured separator and key-value separator, to builder. Identical to appendTo(Appendable, Map), except that it does not throw IOException.
    • join

      public String join(Map<?,?> map)
      Deprecated.
      Returns a string containing the string representation of each entry of map, 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 IOException
      Deprecated.
      Appends the string representation of each entry in entries, using the previously configured separator and key-value separator, to appendable.
      Throws:
      IOException
      Since:
      10.0
    • appendTo

      @Beta public <A extends Appendable> A appendTo(A appendable, Iterator<? extends Map.Entry<?,?>> parts) throws IOException
      Deprecated.
      Appends the string representation of each entry in entries, using the previously configured separator and key-value separator, to appendable.
      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 in entries, using the previously configured separator and key-value separator, to builder. Identical to appendTo(Appendable, Iterable), except that it does not throw IOException.
      Since:
      10.0
    • appendTo

      @Beta public StringBuilder appendTo(StringBuilder builder, Iterator<? extends Map.Entry<?,?>> entries)
      Deprecated.
      Appends the string representation of each entry in entries, using the previously configured separator and key-value separator, to builder. Identical to appendTo(Appendable, Iterable), except that it does not throw IOException.
      Since:
      11.0
    • join

      @Beta public String join(Iterable<? extends Map.Entry<?,?>> entries)
      Deprecated.
      Returns a string containing the string representation of each entry in entries, using the previously configured separator and key-value separator.
      Since:
      10.0
    • join

      @Beta public String join(Iterator<? extends Map.Entry<?,?>> entries)
      Deprecated.
      Returns a string containing the string representation of each entry in entries, using the previously configured separator and key-value separator.
      Since:
      11.0
    • useForNull

      @CheckReturnValue public Joiner.MapJoiner useForNull(String nullText)
      Deprecated.
      Returns a map joiner with the same behavior as this one, except automatically substituting nullText for any provided null keys or values.