You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
to me it was counter intuitive to create a default configured JSONParserConfiguration to then call withStrictMode() on it returning a clone and making the first instance obsolete. I would even need to create multiple clones until I have the correct configuration, when I want to set multiple values. I would like to be able to create my desired configuration in one go.
This would require a Constructor JSONParserConfiguration(boolean overwriteDuplicateKey, boolean strictMode) or even JSONParserConfiguration(boolean overwriteDuplicateKey, boolean strictMode, boolean keepStrings, int maxNestingDepth).
I would also allow the make the configuration fiels final although that would be a backwards compatible breaking change, and therefore will most probably not be added. I would make it reasier to reason about the codes behaviour and avoid the potential of changing an already used configuration.
What do you think of it?
The text was updated successfully, but these errors were encountered:
@Simulant87 It is just the practice for configuration classes in this project. You will see similar APIs in JSONMLParserConfiguration and XMLParserConfiguration. Agreed it can be a bit inefficient, but it also has advantages. For example, XMLParserConfiguration has 6 tunable properties. I wouldn't want to be forced to init all of them when only one needs to be changed.
to me it was counter intuitive to create a default configured
JSONParserConfiguration
to then callwithStrictMode()
on it returning a clone and making the first instance obsolete. I would even need to create multiple clones until I have the correct configuration, when I want to set multiple values. I would like to be able to create my desired configuration in one go.This would require a Constructor
JSONParserConfiguration(boolean overwriteDuplicateKey, boolean strictMode)
or evenJSONParserConfiguration(boolean overwriteDuplicateKey, boolean strictMode, boolean keepStrings, int maxNestingDepth)
.I would also allow the make the configuration fiels
final
although that would be a backwards compatible breaking change, and therefore will most probably not be added. I would make it reasier to reason about the codes behaviour and avoid the potential of changing an already used configuration.What do you think of it?
The text was updated successfully, but these errors were encountered: