如何检查使用Jackson库的JSON是空的还是空的?
我正在尝试对哈希图进行挑选,并且当我尝试使用它时,它正在破坏程序。我想检查json是空的还是空的,然后才能对其进行审理。我该如何检查?
"HashMap<String, Administrador> administradores = new HashMap<>();
///在这里我想检查JSON(Jackson)中是否有东西
administradores =
Persistencia.DEserializeHashMap(Archivos.ADMINISTRADORESALL
.getPath(), String.class, Administrador.class);///deserialize
I'm trying to deserialize a Hashmap and it's breaking the program when i try to use it after. I would like to check if the JSON is null or empty before i deserialize it. How can i check this?
"HashMap<String, Administrador> administradores = new HashMap<>();
///here i want to check if there is something in the JSON (jackson)
administradores =
Persistencia.DEserializeHashMap(Archivos.ADMINISTRADORESALL
.getPath(), String.class, Administrador.class);///deserialize
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
亲自试用您的代码
,我更喜欢使用
com.google.gson.gson.gson
Try-catch your code
Personally, I prefer using
com.google.gson.Gson