private static Map<String, Object> canonicalizeMap(final Map<String, Object> from) { final Map<String, Object> canonicalized = new LinkedHashMap<String, Object>(from.size()); final TreeSet<String> keysInOrder = new TreeSet<String>(from.keySet()); for (final String key : keysInOrder) { final Object val = from.get(key); canonicalized.put(key, canonicalize(val)); } return canonicalized; }
private void putMap(String name, Map m) { _put(OBJECT, name); final int sizePos = _buf.position(); _buf.putInt(0); for (Object key : m.keySet()) _putObjectField(key.toString(), m.get(key)); _buf.put(EOO); _buf.putInt(sizePos, _buf.position() - sizePos); }
private static List<String> facetStringToListOfKeys(String facets) throws Exception { List<String> facetList = new ArrayList<String>(); String array[] = facets.split(","); for (int i = 0; i < array.length; i++) { int temp = Integer.parseInt(array[i]); String key = columnToKey.get(temp); if (key != null) { facetList.add(key); } } return facetList; }