【问题标题】:Writing pojo class for complex payload为复杂的有效负载编写 pojo 类
【发布时间】:2020-11-06 04:38:54
【问题描述】:
  "profile": {
    "role": "xxxxxxxx",

    "groups": [
      "xxxxxxxxx"

    ],
    
  }
}

如何为数组编写pojo clas,其中groups是可以接受任意数量分配组的数组,在数组内部它没有任何键值对,只会获取整数作为值

【问题讨论】:

  • a) 我在这里看不到任何复杂的东西。 b) 我不知道你到底想做什么。
  • 数组永远不需要“键值对”(在 json 中是对象)

标签: java pojo


【解决方案1】:

假设您的role 987654322 @ type和groupsint[](如上所述)。

class profile {
    String role;
    int[] groups;
}

【讨论】:

    猜你喜欢
    • 2021-07-23
    • 2020-11-14
    • 1970-01-01
    • 2019-08-30
    • 2019-01-23
    • 1970-01-01
    • 2012-08-06
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多