Commit cb8e9f42 authored by Quxl's avatar Quxl

x

parent f0dabfa2
......@@ -10,6 +10,7 @@ import java.util.Collection;
import java.util.Date;
import java.util.HashMap;
import java.util.Iterator;
import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map;
import java.util.TreeMap;
......@@ -56,7 +57,7 @@ public class Util {
tmp.put(keys[i], value);
} else {
if(tmp.get(keys[i]) == null) {
tmp.put(keys[i], new HashMap<Object, Object>());
tmp.put(keys[i], new LinkedHashMap<Object, Object>());
}
tmp = (Map<Object, Object>)tmp.get(keys[i]);
}
......@@ -237,7 +238,7 @@ public class Util {
if(obj == null) {
return null;
}
Map<String, Object> map = new HashMap<String, Object>();
Map<String, Object> map = new LinkedHashMap<String, Object>();
if(obj instanceof Map) {
Map<?, ?> objMap = (Map<?, ?>)obj;
for(Object key : objMap.keySet()) {
......@@ -275,7 +276,7 @@ public class Util {
}
public static Map<String, String> ToMap(Map<String, String[]> parameterMap) {
Map<String, String> resultMap = new HashMap<String, String>();
Map<String, String> resultMap = new LinkedHashMap<String, String>();
for(String key : parameterMap.keySet()) {
String[] valueArray = parameterMap.get(key);
resultMap.put(String.valueOf(key), valueArray.length > 0 ? valueArray[0] : null);
......@@ -292,7 +293,7 @@ public class Util {
}
public static <T> Map<String, T> objsToMM(List<T> objs, String bar, String... keyNames) {
Map<String, T> maps = new HashMap<String, T>();
Map<String, T> maps = new LinkedHashMap<String, T>();
if(objs != null) {
for(T obj : objs) {
List<String> keyValues = new ArrayList<String>();
......@@ -309,7 +310,7 @@ public class Util {
}
public static Map<String, Map<String, Object>> listToMM(List<Map<String, Object>> datas, String bar, String... keyNames) {
Map<String, Map<String, Object>> maps = new HashMap<String, Map<String, Object>>();
Map<String, Map<String, Object>> maps = new LinkedHashMap<String, Map<String, Object>>();
if(datas != null) {
for(Map<String, Object> map : datas) {
if(map.size() > 0) {
......@@ -334,7 +335,7 @@ public class Util {
}
public static Map<String, List<Map<String, Object>>> listToML(List<Map<String, Object>> datas, String keyName) {
Map<String, List<Map<String, Object>>> mapDatas = new HashMap<String, List<Map<String, Object>>>();
Map<String, List<Map<String, Object>>> mapDatas = new LinkedHashMap<String, List<Map<String, Object>>>();
if(datas != null) {
for(Map<String, Object> map : datas) {
if(map.size() > 0) {
......@@ -352,7 +353,7 @@ public class Util {
}
public static Map<String, List<Map<String, Object>>> listToML(List<Map<String, Object>> datas, String bar, String... keyName) {
Map<String, List<Map<String, Object>>> mapDatas = new HashMap<String, List<Map<String, Object>>>();
Map<String, List<Map<String, Object>>> mapDatas = new LinkedHashMap<String, List<Map<String, Object>>>();
if(datas != null) {
for(Map<String, Object> map : datas) {
if(map.size() > 0) {
......@@ -462,7 +463,7 @@ public class Util {
* @throws
*/
public static Map<?, ?> reMap(Map<?, ?> fromMap) {
Map<Object, Object> map = new HashMap<Object, Object>();
Map<Object, Object> map = new LinkedHashMap<Object, Object>();
for(Object key : fromMap.keySet()) {
Object obj = fromMap.get(key);
if(obj instanceof Map) {
......@@ -484,7 +485,7 @@ public class Util {
* @return
*/
public static <T> T converArgs(Class<T> type, Map<?, ?> args, String name) {
Map<String, String[]> map = new HashMap<String, String[]>();
Map<String, String[]> map = new LinkedHashMap<String, String[]>();
for(Object arg_key : args.keySet()) {
String key = String.valueOf(arg_key);
if(key.startsWith(name + ".")) {
......
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