Пример #1
0
 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;
 }
Пример #2
0
  private void putMap(String name, Map m) {
    _put(OBJECT, name);
    final int sizePos = _buf.getPosition();
    _buf.writeInt(0);

    for (Map.Entry entry : (Set<Map.Entry>) m.entrySet())
      _putObjectField(entry.getKey().toString(), entry.getValue());

    _buf.write(EOO);
    _buf.writeInt(sizePos, _buf.getPosition() - sizePos);
  }
Пример #3
0
 public void putAll(final Map m) {
   for (final Map.Entry entry : m.entrySet()) {
     this.put(entry.getKey().toString(), entry.getValue());
   }
 }