java.time中的类是否与Joda-Time Interval相当? [英] Is there a class in java.time comparable to the Joda-Time Interval?

查看:300
本文介绍了java.time中的类是否与Joda-Time Interval相当?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在评估将我的项目从使用 Joda-Time 迁移到java.time包 .org / wiki / Java_version_history#Java_SE_8_.28March_18.2C_2014.29> Java 8 。在Joda-Time,我大量使用了 Interval 类。我在java.time中找不到这样的东西。

I'm evaluating to migrate my project from the usage of Joda-Time to the java.time package in Java 8. In Joda-Time, I heavily used the Interval class. I could not find anything like this in java.time.

是否有类似的课程?

推荐答案

对不起, JSR-310与JodaTime-Interval-class没有对应关系。我怀疑这是否会发生,但项目负责人Stephen Colebourne认为至少在他的外部库Threeten-Extra的范围内支持它,请参阅问题

Sorry for you, there is no equivalent in JSR-310 to JodaTime-Interval-class. I have doubts if this will ever come, but project lead Stephen Colebourne considers at least to support it in the scope of his external library Threeten-Extra, see this issue.

如果您对JodaTime感到满意,您应该保留它。并非JodaTime中的所有内容都移植到Java 8(Interval不是唯一的问题)。

If you are happy with JodaTime you should keep it. Not everything in JodaTime is ported to Java 8 (Interval is not the only issue).

从2014-12-13更新:

Java-8中的情况没有改变,但您可能还会考虑除Joda-Time之外的其他外部库。 Threeten-Extra现在包括一个非常简单的间隔类,自v0.9(参见S. Colebourne的另一个答案)或我的库Time4J提供范围包自v2.0起。

The situation in Java-8 has not changed, but you might also consider other external libraries beyond Joda-Time. Either Threeten-Extra which now includes a very simple interval class since v0.9 (see the other answer of S. Colebourne here) or my library Time4J which offers the range package since v2.0.

这篇关于java.time中的类是否与Joda-Time Interval相当?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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