From: Stephen Colebourne <scolebourne@jo...> - 2012-05-04 17:42:51
One idea that may be of interest is a DateTimeObject interface. It
would be a bit like CalendricalObject and have an API like
long get(DateTimeField field);
DateTimeObject with(DateTimeField field, long newValue);
DateTimeObject plus(long period, PeriodUnit unit);
DateTimeObject minus(long period, PeriodUnit unit);
It would be implemented by all the major date/time classes, but not by
ZoneId, ZoneOffset and other non date/time calendricals.
The real question is whether an additional interface adds value. If a
way could be found to make the fields use this interface (or a more
restrictive LocalObject only implemented by LD/LT/LDT) then it would
perhaps be a useful additon.
I haven't added it because I can't see how it simplifies or unifies things ATM.
Anyway, food for thought.
Get latest updates about Open Source Projects, Conferences and News.