Now there is a bean list that needs to be split into multiple member lists. How to write it better?
public class User {
private String name;
private String age;
//..getter,settter省略
}
List<User> data = ...
List<String> name = data里的所有name
List<String> age = ...
Map<String,User> should satisfy you. The key is name and the value is placed directly in the bean