com.rumwei.util.MapUtilGW Maven / Gradle / Ivy
package com.rumwei.util;
import lombok.extern.slf4j.Slf4j;
import java.util.HashMap;
import java.util.Map;
@Slf4j
public class MapUtilGW {
/*
* 构建一个Map对象,key为key+i,value为value+i,其中1<=i<=num
* @Info: 底层为HashMap
* */
public static Map generateMapString(String key, String value, int num){
Map result = new HashMap();
for (int i=1; i<=num; i++){
result.put(key+i,value+i);
}
return result;
}
/*
* 构建一个Map对象,key为i,value为i,其中1<=i<=num
* @Info: 底层为HashMap
* */
public static Map generateMapInteger(int num){
Map result = new HashMap();
for (int i=1; i<=num; i++){
result.put(i,i);
}
return result;
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy