java - Json object, convert json array into a json object in java
问题描述
I have one json array like this
"values":[
{
"locale":"en_US",
"source_key":"book_format",
"value":"Hardback",
"display_attr_name":"Book Format",
"source_value":"Hardback",
"isPrimary":"true"
},
{
"isFacetValue":"true",
"facet_version":"1.1",
"locale":"en_US",
"value":"Hardcover"
}
]
I need to get the only the distinct keys from above json array
{
"locale":"en_US",
"source_key":"book_format",
"value":"Hardback",
"display_attr_name":"Book Format",
"source_value":"Hardback",
"isPrimary":"true",
"isFacetValue":"true",
"facet_version":"1.1"
}
And the output will be in the form of jsonobject.
解决方案
推荐阅读
- c# - 如何解决使用现有列将行添加到 datagridview 的问题?
- android - 为什么不选择可能的最低 minSdkVersion?有什么缺点?
- python - 将条件格式应用于熊猫数据框中的整行
- linux-kernel - 使用没有 libvirt 的 ubuntu 在 qemu 中定义大页面
- c# - UWP:导航视图未完全延伸到标题栏
- ios - 约束不能以编程方式快速工作
- c++ - Cmake Fails to Link DL Library
- linux - Struggling with Linux IPTables with dynamic IP
- scala - Accessing ScalaFX chart axis extreme values
- salesforce - 在工作区中找不到名为boatMessageChannel 的 LightningMessageChannel