You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@qpid.apache.org by ra...@apache.org on 2015/08/14 21:08:04 UTC

[31/50] [abbrv] qpid-proton git commit: Added support methods to handle maps with String, Symbols as keys.

Added support methods to handle maps with String, Symbols as keys.


Project: http://git-wip-us.apache.org/repos/asf/qpid-proton/repo
Commit: http://git-wip-us.apache.org/repos/asf/qpid-proton/commit/1ff83671
Tree: http://git-wip-us.apache.org/repos/asf/qpid-proton/tree/1ff83671
Diff: http://git-wip-us.apache.org/repos/asf/qpid-proton/diff/1ff83671

Branch: refs/heads/rajith-codec
Commit: 1ff8367199b27c95758f89e7ab5419db4babff34
Parents: 2e8ccc9
Author: Rajith Attapattu <ra...@apache.org>
Authored: Fri Feb 20 20:20:28 2015 -0500
Committer: Rajith Attapattu <ra...@apache.org>
Committed: Thu Jul 9 09:12:38 2015 -0400

----------------------------------------------------------------------
 .../apache/qpid/proton/codec2/CodecHelper.java  | 32 ++++++++++++++++++++
 1 file changed, 32 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/1ff83671/proton-j/src/main/java/org/apache/qpid/proton/codec2/CodecHelper.java
----------------------------------------------------------------------
diff --git a/proton-j/src/main/java/org/apache/qpid/proton/codec2/CodecHelper.java b/proton-j/src/main/java/org/apache/qpid/proton/codec2/CodecHelper.java
index a5f6a85..235d445 100644
--- a/proton-j/src/main/java/org/apache/qpid/proton/codec2/CodecHelper.java
+++ b/proton-j/src/main/java/org/apache/qpid/proton/codec2/CodecHelper.java
@@ -63,6 +63,38 @@ public class CodecHelper
         encoder.end();
     }
 
+    public static void encodeMapWithKeyAsString(Encoder encoder, Map<String, Object> map)
+    {
+        if (map == null)
+        {
+            encoder.putNull();
+            return;
+        }
+        encoder.putMap();
+        for (String key : map.keySet())
+        {
+            encoder.putString(key);
+            encodeObject(encoder, map.get(key));
+        }
+        encoder.end();
+    }
+    
+    public static void encodeMapWithKeyAsSymbol(Encoder encoder, Map<String, Object> map)
+    {
+        if (map == null)
+        {
+            encoder.putNull();
+            return;
+        }
+        encoder.putMap();
+        for (String key : map.keySet())
+        {
+            encoder.putSymbol(key);
+            encodeObject(encoder, map.get(key));
+        }
+        encoder.end();
+    }
+    
     public static void encodeList(Encoder encoder, List<Object> list)
     {
         if (list == null)


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@qpid.apache.org
For additional commands, e-mail: commits-help@qpid.apache.org