We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
对您想要需求或建议的清晰简洁的描述。 能不能在jsonobject和jsonarray上加上带有默认值得获取方法,比如getDateOrDefault(keyName,defaultValue)这样的,或者直接重载getDate(keyName,defaultValue) 现有的只有一个getOrDefault方法返回的是一个object很多时候无法直接使用,而且例如getInteger这样的会对一些常见类型自动转换比如字符串“111”转成int的111,尤其是getDate这个方法,现在可以将json中有个key:"2023/3/19 18:56:02"直接转成Date,getOrDefault貌似不行,有个getDateOrDefault("key",new Date())不是会方便很多吗
对您想要需求或建议的实现方案的详细描述。
对您考虑过的任何替代解决方案或功能的描述。 替代方案的话在hutool的json,apache camel的json中都有类似的方法
如果你还有其他需要提供的信息,可以在这里填写(可以提供截图、视频等)。
The text was updated successfully, but these errors were encountered:
可以的啊,你可以提交一个PR参与进来么?
Sorry, something went wrong.
add getDateOrDefault, for issue #1252
d882688
https://github.com/alibaba/fastjson2/releases/tag/2.0.27 请用新版本
No branches or pull requests
请描述您的需求或者改进建议
对您想要需求或建议的清晰简洁的描述。
能不能在jsonobject和jsonarray上加上带有默认值得获取方法,比如getDateOrDefault(keyName,defaultValue)这样的,或者直接重载getDate(keyName,defaultValue)
现有的只有一个getOrDefault方法返回的是一个object很多时候无法直接使用,而且例如getInteger这样的会对一些常见类型自动转换比如字符串“111”转成int的111,尤其是getDate这个方法,现在可以将json中有个key:"2023/3/19 18:56:02"直接转成Date,getOrDefault貌似不行,有个getDateOrDefault("key",new Date())不是会方便很多吗
请描述你建议的实现方案
对您想要需求或建议的实现方案的详细描述。
描述您考虑过的替代方案
对您考虑过的任何替代解决方案或功能的描述。
替代方案的话在hutool的json,apache camel的json中都有类似的方法
附加信息
如果你还有其他需要提供的信息,可以在这里填写(可以提供截图、视频等)。
The text was updated successfully, but these errors were encountered: