Commit 19f5d621 authored by yanzg's avatar yanzg

接口文档的支持

parent bafd2fc1
......@@ -6,6 +6,22 @@ import java.util.Map;
public class MapHelper {
/**
* 将一个对象列表转换为HashMap
*
* @param list 需要转换的列表
* @param <T>
* @return
*/
public static <T extends MapKey> Map<String, T> getMap(List<T> list) {
Map<String, T> map = new HashMap<>();
for (T item : list) {
String key = item.getKey(item);
map.put(key, item);
}
return map;
}
/**
* 将一个对象列表转换为HashMap
*
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment