Commit b9d986f5 authored by yanzg's avatar yanzg

下载视频

parent f1f7d5ee
...@@ -93,4 +93,23 @@ public class MapHelper { ...@@ -93,4 +93,23 @@ public class MapHelper {
public interface MapKey<T> { public interface MapKey<T> {
String getKey(T from); String getKey(T from);
} }
/**
* 将建添加到子数组中
*
* @param mapList
* @param key
* @param item
* @param <T>
* @param <M>
* @return
*/
public static <T, M> List<M> addMapList(Map<T, List<M>> mapList, T key, M item) {
if (!mapList.containsKey(key)) {
mapList.put(key, new ArrayList<>());
}
List<M> ret = mapList.get(key);
ret.add(item);
return ret;
}
} }
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