added MapUtils to deal with object/string translation in acs7

This commit is contained in:
2022-07-05 21:15:13 +01:00
parent b8d23408c8
commit 64218fe467

View File

@@ -0,0 +1,22 @@
package com.inteligr8.alfresco.acs;
import java.util.HashMap;
import java.util.Map;
import java.util.Map.Entry;
public class MapUtils {
public static Map<String, String> toStringMap(Map<String, ?> map) {
if (map == null)
return null;
Map<String, String> strmap = new HashMap<>(map.size());
for (Entry<String, ?> element : map.entrySet()) {
String strvalue = element.getValue() == null ? null : element.getValue().toString();
strmap.put(element.getKey(), strvalue);
}
return strmap;
}
}