-
Notifications
You must be signed in to change notification settings - Fork 3.4k
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
Duration, SizeUnit could implement Serializable #2971
Comments
For Duration I would recommend using the JDK instead, which is already serializable. In fact it may be worth the discussion to see if dropwizard's Duration should be deprecated or modified to extend the JDK Duration. https://docs.oracle.com/javase/8/docs/api/java/time/Duration.html |
My use case is solely configuration; I prefer something friendly like |
Thank you, @joschi! |
I often use
Duration
andSizeUnit
for configuration parameters. Because these classes do not implementjava.io.Serializable
, they cause issues when Jackson isn't the serializer. For example, they cause exceptions in Spark jobs when utilized as part of the task (i.e. in a lambda).I believe that implementing
Serializable
on these classes is low impact, since the interface is purely semantic. Adding aserialVersionUID
would be the only other change. Happy to PR this if someone agrees?The text was updated successfully, but these errors were encountered: