Returns a joiner with the same behavior as this one, except automatically substituting nullText for any provided null elements.
(final String nullText)
| 240 | |
| 241 | |
| 242 | public Joiner useForNull(final String nullText) { |
| 243 | checkNotNull(nullText); |
| 244 | return new Joiner(this) { |
| 245 | @Override |
| 246 | CharSequence toString(@Nullable Object part) { |
| 247 | return (part == null) ? nullText : Joiner.this.toString(part); |
| 248 | } |
| 249 | |
| 250 | @Override |
| 251 | public Joiner useForNull(String nullText) { |
| 252 | throw new UnsupportedOperationException("already specified useForNull"); |
| 253 | } |
| 254 | |
| 255 | @Override |
| 256 | public Joiner skipNulls() { |
| 257 | throw new UnsupportedOperationException("already specified useForNull"); |
| 258 | } |
| 259 | }; |
| 260 | } |
| 261 | |
| 262 | /** |
| 263 | * Returns a joiner with the same behavior as this joiner, except automatically skipping over any |
no test coverage detected