google collections Joiner线程是否安全?
答案 0 :(得分:28)
是的!我们不打算重复SimpleDateFormat
的错误。 : - )
Joiner
需要获得与其姐妹班Splitter
获得的类似文档升级,其中说:
* <p><b>Warning: splitter instances are always immutable</b>; a configuration
* method such as {@code omitEmptyStrings} has no effect on the instance it
* is invoked on! You must store and use the new splitter instance returned by
* the method. This makes splitters thread-safe, and safe to store as {@code
* static final} constants . . .
答案 1 :(得分:16)
唯一的状态是
private final String separator;
所以是的,它是线程安全的。