如何在Java 8中动态过滤嵌套列表对象
示例:
示例:
class Items {
List<Mobile> mobiles;
}
class Mobile{
String mName;
List<Plans> plans;
}
class Plans{
String planId;
String planName;
}
我有3个手机(手机数量可能会动态变化,例如3个或4个等),每个手机设备上都有多个计划。如何动态过滤出每个手机设备的共同计划?
Items:
M1 - P1,P2,P3,P4
M2 - P4,P5,P6,P1,P8,P2
M3 - P7,P2,P4,P1,P8,P9,P10
Items:
M1 - P1,P2,P4
M2 - P1,P2,P4
M3 - P1,P2,P4