如何过滤动态嵌套列表对象java 8
Example:
class Items {
List<Mobile> mobiles;
}
class Mobile{
String mName;
List<Plans> plans;
}
class Plans{
String planId;
String planName;
}
因此,我有 3 部手机(手机将是动态 3 或 4 等),每个移动设备上都有多个计划。如何动态过滤每个移动设备的通用计划?
Example(P1-planId) :
Items:
M1 - P1,P2,P3,P4
M2 - P4,P5,P6,P1,P8,P2
M3 - P7,P2,P4,P1,P8,P9,P10
Result:
Items:
M1 - P1,P2,P4
M2 - P1,P2,P4
M3 - P1,P2,P4