首页 > 解决方案 > 为复杂的有效负载编写 pojo 类

问题描述

  "profile": {
    "role": "xxxxxxxx",

    "groups": [
      "xxxxxxxxx"

    ],
    
  }
}

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

标签: javapojo

解决方案


假设你roleString类型并且groupsint[](正如你提到的)。

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

推荐阅读