/** skipNulls与useForNull不能同时使用 */ @Test public void testJoiner03() { Joiner joiner = Joiner.on(",").skipNulls(); joiner.useForNull("missing"); String result = joiner.join(lists); System.out.println(result); ; }
/** * Returns a map joiner with the same behavior as this one, except automatically substituting * {@code nullText} for any provided null keys or values. */ @CheckReturnValue public MapJoiner useForNull(String nullText) { return new MapJoiner(joiner.useForNull(nullText), keyValueSeparator); }