Open gastaldi opened 3 years ago
Another solution is to return a different object when these methods are called, which I think it makes more sense
@gastaldi Hey! Thanks so much for the idea. I like it. Want to put together a PR? I still have a few things to merge in from the Java 8 update, but this would be a cool improvement. I think it would likely need to bump the major version though.
I wouldn't mind cleaning up some of the APIs at the same time, too.
In many cases,
PrettyTime
can be initialized only once and reused during the application's lifetime. However methods likesetLocale
andsetReference
may impact on this approach.Therefore it would be nice if the
PrettyTime
object were immutable and methods that change the object's state were deprecated in favor of using it through a constructor