Recursive reading of List<Object>

前端 未结 5 1723
滥情空心
滥情空心 2020-12-17 07:18

I have this structure of List, to be specific it is a \"CategoryItem\" Object. Here\'s my declaration of \"CategoryItem\" Object.

         


        
      
      
      
5条回答
  •  抹茶落季
    2020-12-17 08:02

    A simple not optimal but simple solution will be to just iterate the list and for each of the items you count how many times you call its parent id before it its 0. So then you know how many levels of identation your

  • must have.

提交回复
热议问题