cn.dreampie.common.util
类 Joiner.MapJoiner

java.lang.Object
  继承者 cn.dreampie.common.util.Joiner.MapJoiner
包容类:
Joiner

public static final class Joiner.MapJoiner
extends Object

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:

从以下版本开始:
2.0 (imported from Google Collections Library)

方法摘要
<A extends Appendable>
A
appendTo(A appendable, Iterable<? extends Map.Entry<?,?>> entries)
          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)
          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)
          Appends the string representation of each entry of map, using the previously configured separator and key-value separator, to appendable.
 StringBuilder appendTo(StringBuilder builder, Iterable<? extends Map.Entry<?,?>> entries)
          Appends the string representation of each entry in entries, using the previously configured separator and key-value separator, to builder.
 StringBuilder appendTo(StringBuilder builder, Iterator<? extends Map.Entry<?,?>> entries)
          Appends the string representation of each entry in entries, using the previously configured separator and key-value separator, to builder.
 StringBuilder appendTo(StringBuilder builder, Map<?,?> map)
          Appends the string representation of each entry of map, using the previously configured separator and key-value separator, to builder.
 String join(Iterable<? extends Map.Entry<?,?>> entries)
          Returns a string containing the string representation of each entry in entries, using the previously configured separator and key-value separator.
 String join(Iterator<? extends Map.Entry<?,?>> entries)
          Returns a string containing the string representation of each entry in entries, using the previously configured separator and key-value separator.
 String join(Map<?,?> map)
          Returns a string containing the string representation of each entry of map, using the previously configured separator and key-value separator.
 Joiner.MapJoiner useForNull(String nullText)
          Returns a map joinKit with the same behavior as this one, except automatically substituting nullText for any provided null keys or values.
 
从类 java.lang.Object 继承的方法
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

方法详细信息

appendTo

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

抛出:
IOException

appendTo

public StringBuilder appendTo(StringBuilder builder,
                              Map<?,?> map)
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)
Returns a string containing the string representation of each entry of map, using the previously configured separator and key-value separator.


appendTo

public <A extends Appendable> A appendTo(A appendable,
                                         Iterable<? extends Map.Entry<?,?>> entries)
                              throws IOException
Appends the string representation of each entry in entries, using the previously configured separator and key-value separator, to appendable.

抛出:
IOException

appendTo

public <A extends Appendable> A appendTo(A appendable,
                                         Iterator<? extends Map.Entry<?,?>> parts)
                              throws IOException
Appends the string representation of each entry in entries, using the previously configured separator and key-value separator, to appendable.

抛出:
IOException

appendTo

public StringBuilder appendTo(StringBuilder builder,
                              Iterable<? extends Map.Entry<?,?>> entries)
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.


appendTo

public StringBuilder appendTo(StringBuilder builder,
                              Iterator<? extends Map.Entry<?,?>> entries)
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.


join

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


join

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


useForNull

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



Copyright © 2015. All rights reserved.