Commit 64218fe4 authored by Brian Long's avatar Brian Long
Browse files

added MapUtils to deal with object/string translation in acs7

parent b8d23408
Loading
Loading
Loading
Loading
+22 −0
Original line number Diff line number Diff line
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;
	}

}