Returns a joiner with the same behavior as this one, except automatically substituting nullText for any provided null elements.
(final String nullText)
| 220 | * nullText} for any provided null elements. |
| 221 | */ |
| 222 | public Joiner useForNull(final String nullText) { |
| 223 | checkNotNull(nullText); |
| 224 | return new Joiner(this) { |
| 225 | @Override |
| 226 | CharSequence toString(@Nullable Object part) { |
| 227 | return (part == null) ? nullText : Joiner.this.toString(part); |
| 228 | } |
| 229 | |
| 230 | @Override |
| 231 | public Joiner useForNull(String nullText) { |
| 232 | throw new UnsupportedOperationException("already specified useForNull"); |
| 233 | } |
| 234 | |
| 235 | @Override |
| 236 | public Joiner skipNulls() { |
| 237 | throw new UnsupportedOperationException("already specified useForNull"); |
| 238 | } |
| 239 | }; |
| 240 | } |
| 241 | |
| 242 | /** |
| 243 | * Returns a joiner with the same behavior as this joiner, except automatically skipping over any |
no test coverage detected