List<Map<String, Object>>
时间: 2023-10-29 11:45:00 浏览: 39
This is a data structure in Java that represents a list of maps, where each map contains key-value pairs. The key is a string, and the value can be any object.
For example, let's say we have a list of employees, and each employee has a name, age, and salary. We can represent this data using a List<Map<String, Object>> as follows:
List<Map<String, Object>> employees = new ArrayList<>();
Map<String, Object> employee1 = new HashMap<>();
employee1.put("name", "John");
employee1.put("age", 30);
employee1.put("salary", 50000.0);
employees.add(employee1);
Map<String, Object> employee2 = new HashMap<>();
employee2.put("name", "Mary");
employee2.put("age", 25);
employee2.put("salary", 60000.0);
employees.add(employee2);
In this example, we have a list of two maps, where each map represents an employee. The keys in each map are "name", "age", and "salary", and the values can be any object (in this case, a String, an Integer, and a Double, respectively).
We can then access the data using various methods, such as iterating over the list and retrieving the values for each key, or using streams to filter and manipulate the data.