| java.lang.Object | |
| ↳ | com.google.gdata.util.common.base.Joiner |
An object which joins pieces of text (specified as an array, Iterable, varargs or even a Map) with a separator. It either appends the results to an Appendable or returns them as a String. Example:
Joiner joiner = Joiner.on("; ").skipNulls();
. . .
return joiner.join("Harry", null, "Ron", "Hermione");
This returns the string "Harry; Ron; Hermione". Note that all input
elements are converted to strings using toString() before
being appended.
If neither skipNulls() nor useForNull(String) is
specified, the joining methods will throw NullPointerException if any
given element is null.
| Nested Classes | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
| Joiner.MapJoiner | An object that joins map entries in the same manner as Joiner joins
iterables and arrays. |
||||||||||
| Fields | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
| separator | |||||||||||
| Public Methods | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
Appends the string representation of each of
parts, using the
previously configured separator between each, to builder. | |||||||||||
Appends the string representation of each of
parts, using the
previously configured separator between each, to appendable. | |||||||||||
Appends the string representation of each of
parts, using the
previously configured separator between each, to builder. | |||||||||||
Appends to
appendable the string representation of each of the
remaining arguments. | |||||||||||
Appends to
builder the string representation of each of the
remaining arguments. | |||||||||||
Appends the string representation of each of
parts, using the
previously configured separator between each, to appendable. | |||||||||||
Returns a string containing the string representation of each of
parts, using the previously configured separator between each. | |||||||||||
Returns a string containing the string representation of each argument,
using the previously configured separator between each.
| |||||||||||
Returns a string containing the string representation of each of
parts, using the previously configured separator between each. | |||||||||||
Returns a joiner which automatically places
separator between
consecutive elements. | |||||||||||
Returns a joiner with the same behavior as this joiner, except
automatically skipping over any provided null elements.
| |||||||||||
Returns a joiner with the same behavior as this one, except automatically
substituting
nullText for any provided null elements. | |||||||||||
Returns a
MapJoiner using the given key-value separator, and the
same configuration as this Joiner otherwise. | |||||||||||
|
[Expand]
Inherited Methods | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
From class
java.lang.Object
| |||||||||||
Appends the string representation of each of parts, using the
previously configured separator between each, to builder. Identical
to appendTo(Appendable, Iterable), except that it does not throw
IOException.
| builder | |
|---|---|
| parts |
Appends the string representation of each of parts, using the
previously configured separator between each, to appendable.
| appendable | |
|---|---|
| parts |
| IOException |
|---|
Appends the string representation of each of parts, using the
previously configured separator between each, to builder. Identical
to appendTo(Appendable, Iterable), except that it does not throw
IOException.
| builder | |
|---|---|
| parts |
Appends to appendable the string representation of each of the
remaining arguments.
| appendable | |
|---|---|
| first | |
| second | |
| rest |
| IOException |
|---|
Appends to builder the string representation of each of the
remaining arguments. Identical to appendTo(Appendable, Object, Object, Object[]), except that it does not throw IOException.
| builder | |
|---|---|
| first | |
| second | |
| rest |
Appends the string representation of each of parts, using the
previously configured separator between each, to appendable.
| appendable | |
|---|---|
| parts |
| IOException |
|---|
Returns a string containing the string representation of each of parts, using the previously configured separator between each.
| parts |
|---|
Returns a string containing the string representation of each argument, using the previously configured separator between each.
| first | |
|---|---|
| second | |
| rest |
Returns a string containing the string representation of each of parts, using the previously configured separator between each.
| parts |
|---|
Returns a joiner which automatically places separator between
consecutive elements.
| separator |
|---|
Returns a joiner with the same behavior as this joiner, except automatically skipping over any provided null elements.
Returns a joiner with the same behavior as this one, except automatically
substituting nullText for any provided null elements.
| nullText |
|---|
Returns a MapJoiner using the given key-value separator, and the
same configuration as this Joiner otherwise.
| keyValueSeparator |
|---|