李永德
2 years ago
3 changed files with 62 additions and 7 deletions
@ -0,0 +1,20 @@ |
|||
package org.nl.wms.util; |
|||
|
|||
|
|||
import java.io.Serializable; |
|||
import java.util.HashMap; |
|||
|
|||
/* |
|||
* @author ZZQ |
|||
* @Date 2022/11/29 2:55 下午 |
|||
*/ |
|||
public class MapOf implements Serializable { |
|||
|
|||
public static <K> HashMap of(K... key){ |
|||
HashMap map = new HashMap<>(); |
|||
for (int i = 0; i < (key.length & ~1); i=i+2) { |
|||
map.put(key[i],key[i+1]); |
|||
} |
|||
return map; |
|||
} |
|||
} |
Loading…
Reference in new issue