-
-
Notifications
You must be signed in to change notification settings - Fork 180
Description
(note: inspired by #439 work)
As things are, KotlinModule
has a few configuration options, and at least 4 are boolean-valued (plus #439 would add one more, at least temporarily). Since they have to be passed separately, adding a new option requires more changes than is ideal, and technically also reduces cross-version compatibility (although constructors should not really be called from outside).
Most Jackson components offer Feature
style on/off settings, in which we can have up to 31 options (or, if using long
, 63 -- and of course with diff. backends even more) and make it much easier to add new options, only adding enum entries but no need to add new methods, constructors etc.
Implementation for int
-backed variant -- which I think is sufficient for Kotlin module, with a smallish set of on/off things -- is done by implementing JacksonFeature
. I don't deeply care if that is used or something else, but I think the general idea is good.
(note: the reason I chose not to use BitSet
from JDK originally was because that is not immutable so copies were needed; any similar data struct is fine with me).