|
@@ -112,7 +112,11 @@ public class MapUtil {
|
|
|
* @describe mybatis返回结果转换为Map
|
|
|
*/
|
|
|
public static <T,K> Map convertMybatisMap(List<Map<T,K>> maps){
|
|
|
- Map result=new HashMap(maps.size());
|
|
|
+ int size = 0;
|
|
|
+ if(maps != null){
|
|
|
+ size = maps.size();
|
|
|
+ }
|
|
|
+ Map result=new HashMap(size);
|
|
|
maps.forEach(stringIntegerMap -> {
|
|
|
if(Objects.isNull(stringIntegerMap)){
|
|
|
return;
|
|
@@ -130,7 +134,11 @@ public class MapUtil {
|
|
|
* @describe mybatis返回结果转换为Map
|
|
|
*/
|
|
|
public static <T,K> Map convertIntegerMap(List<Map<T,K>> maps){
|
|
|
- Map result=new HashMap(maps.size());
|
|
|
+ int size = 0;
|
|
|
+ if(maps != null){
|
|
|
+ size = maps.size();
|
|
|
+ }
|
|
|
+ Map result=new HashMap(size);
|
|
|
maps.forEach(stringIntegerMap -> {
|
|
|
if(Objects.isNull(stringIntegerMap)){
|
|
|
return;
|