| Modifier and Type | Method and Description |
|---|---|
Joiner |
ignoreEmptyStrings()
Returns a new
Joiner that will behave as this one except that
it will ignore empty input Strings. |
Joiner |
ignoreNulls()
Returns a new
Joiner that will behave as this one except that
it will ignore null input values. |
String |
join(Iterable<?> parts)
Joins the given
Strings according to its configuration. |
String |
join(Object... parts)
Joins the given
Strings according to its configuration. |
static Joiner |
on(String separator)
Returns a new
Joiner that will use the specified separator,
no prefix, no suffix and "null" for null values. |
Joiner |
replaceEmptyStringWith(String forEmpty)
Returns a new
Joiner that will behave as this one except that
it will replace empty input Strings with the specified value. |
Joiner |
replaceNullWith(String forNull)
Returns a new
Joiner that will behave as this one except that
it will replace null input values with the specified
String. |
Joiner |
trimInputs()
Returns a new
Joiner that will behave as this one except that
it will trim inputs before joining them. |
Joiner |
withPrefix(String prefix)
Returns a new
Joiner that will behave as this one except that
it will use the specified prefix when joining Strings. |
Joiner |
withSuffix(String suffix)
Returns a new
Joiner that will behave as this one except that
it will use the specified suffix when joining Strings. |
public static Joiner on(String separator)
Joiner that will use the specified separator,
no prefix, no suffix and "null" for null values.separator - the separator.Joiner.NullPointerException - if separator is null.public Joiner trimInputs()
Joiner that will behave as this one except that
it will trim inputs before joining them.Joiner with the desired configuration.public Joiner ignoreNulls()
Joiner that will behave as this one except that
it will ignore null input values.Joiner with the desired configuration.public Joiner ignoreEmptyStrings()
Joiner that will behave as this one except that
it will ignore empty input Strings.Joiner with the desired configuration.public Joiner replaceNullWith(String forNull)
Joiner that will behave as this one except that
it will replace null input values with the specified
String.forNull - the String to use for nulls.Joiner with the desired configuration.NullPointerException - if forNull is null.public Joiner replaceEmptyStringWith(String forEmpty)
Joiner that will behave as this one except that
it will replace empty input Strings with the specified value.forEmpty - the value to use for empty Strings.Joiner with the desired configuration.NullPointerException - if forEmpty is null.public Joiner withPrefix(String prefix)
Joiner that will behave as this one except that
it will use the specified prefix when joining Strings.prefix - the prefix.Joiner with the desired configuration.NullPointerException - if prefix is null.public Joiner withSuffix(String suffix)
Joiner that will behave as this one except that
it will use the specified suffix when joining Strings.suffix - the suffix.Joiner with the desired configuration.NullPointerException - if suffix is null.public String join(Object... parts)
Strings according to its configuration.parts - the parts to join.String.NullPointerException - if parts is null.public String join(Iterable<?> parts)
Strings according to its configuration.parts - the parts to join.String.NullPointerException - if parts is null.Copyright © 2012–2015. All rights reserved.