-
Notifications
You must be signed in to change notification settings - Fork 253
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Make PrettyTime immutable #211
Comments
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 constructorThe text was updated successfully, but these errors were encountered: