java - 为复杂的有效负载编写 pojo 类
问题描述
"profile": {
"role": "xxxxxxxx",
"groups": [
"xxxxxxxxx"
],
}
}
如何为数组编写pojo clas,这里的groups是可以接受任意数量的分配组的数组,在数组内部它没有任何键值对,只会得到整数作为值
解决方案
假设你role
是String
类型并且groups
是int[]
(正如你提到的)。
class profile {
String role;
int[] groups;
}
推荐阅读
- python - 由于缺少 pandoc,构建文档失败
- c# - Android 设备重新启动 Xamarin Forms App C# 后重复通知丢失
- python - 用于 NLP 的 TensorFlow CNN 不会收敛
- azure-eventhub - 如何对 Power Automate Flow 中的 bas64 编码触发器输出采取条件操作?
- android - 如何在Android App中记录按钮点击
- javascript - 如何处理 Angular 中 render2 抛出的错误?
- r - 如何在 R 和 Stata 中创建 2000 个观察值的随机虚拟变量?
- c# - linq计数二次分组和计数不分组
- c++ - 为什么 C++20 中的 [[likely]] 属性会在此处引发警告?
- python-3.x - 嵌套子列表中的元素数(从第一个索引开始)