MCPcopy Create free account
hub / github.com/antlr/codebuff / useForNull

Method useForNull

corpus/java/training/guava/base/Joiner.java:222–240  ·  view source on GitHub ↗

Returns a joiner with the same behavior as this one, except automatically substituting nullText for any provided null elements.

(final String nullText)

Source from the content-addressed store, hash-verified

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

Callers 3

Collections2Class · 0.45
TypesClass · 0.45
useForNullMethod · 0.45

Calls 1

checkNotNullMethod · 0.45

Tested by

no test coverage detected