Joda-Time DateTimeFormatter类线程安全吗? [英] Is Joda-Time DateTimeFormatter class thread safe?

查看:175
本文介绍了Joda-Time DateTimeFormatter类线程安全吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Joda-Time DateTimeFormatter class 线程安全?从 DateTimeFormat.forPattern 获取实例后,多个线程可以调用其各种解析方法吗? DateTimeFormatter的 Javadocs 没有提及线程安全性。

Is the Joda-Time DateTimeFormatter class thread safe? Once I get an instance from DateTimeFormat.forPattern, can its various parse methods be called by multiple threads? DateTimeFormatter's Javadocs makes no mention of thread safety.

推荐答案

是的,它是


DateTimeFormat是线程安全且不可变的,并且格式化程序它也是
返回。

DateTimeFormat is thread-safe and immutable, and the formatters it returns are as well.

以及 Java 8版本


实现要求:此类是不可变且线程安全的。

Implementation Requirements: This class is immutable and thread-safe.

这篇关于Joda-Time DateTimeFormatter类线程安全吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆