polygene-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From nic...@apache.org
Subject [2/6] zest-qi4j git commit: For got to commit the Option setting for the new Map serialization to work.
Date Wed, 17 Jun 2015 03:10:08 GMT
For got to commit the Option setting for the new Map serialization to work.


Project: http://git-wip-us.apache.org/repos/asf/zest-qi4j/repo
Commit: http://git-wip-us.apache.org/repos/asf/zest-qi4j/commit/c2dafaf5
Tree: http://git-wip-us.apache.org/repos/asf/zest-qi4j/tree/c2dafaf5
Diff: http://git-wip-us.apache.org/repos/asf/zest-qi4j/diff/c2dafaf5

Branch: refs/heads/develop
Commit: c2dafaf516401561c8aaf88eb32b3849ac2948f5
Parents: 6b068de
Author: Niclas Hedhman <niclas@hedhman.org>
Authored: Wed Jun 17 10:34:22 2015 +0800
Committer: Niclas Hedhman <niclas@hedhman.org>
Committed: Wed Jun 17 10:34:22 2015 +0800

----------------------------------------------------------------------
 .../main/java/org/qi4j/api/value/ValueSerializer.java   | 12 ++++++++++++
 1 file changed, 12 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/zest-qi4j/blob/c2dafaf5/core/api/src/main/java/org/qi4j/api/value/ValueSerializer.java
----------------------------------------------------------------------
diff --git a/core/api/src/main/java/org/qi4j/api/value/ValueSerializer.java b/core/api/src/main/java/org/qi4j/api/value/ValueSerializer.java
index 7f22d70..337c37e 100644
--- a/core/api/src/main/java/org/qi4j/api/value/ValueSerializer.java
+++ b/core/api/src/main/java/org/qi4j/api/value/ValueSerializer.java
@@ -174,6 +174,7 @@ public interface ValueSerializer
          * Default to TRUE.
          */
         public static final String INCLUDE_TYPE_INFO = "includeTypeInfo";
+        public static final String MAP_ENTRIES_AS_OBJECTS = "mapentriesasobjects";
         private final Map<String, String> options = new HashMap<>();
 
         /**
@@ -182,6 +183,7 @@ public interface ValueSerializer
         public Options()
         {
             this.options.put( INCLUDE_TYPE_INFO, "true" );
+            this.options.put( MAP_ENTRIES_AS_OBJECTS, "false" );
         }
 
         /**
@@ -202,6 +204,16 @@ public interface ValueSerializer
             return put( INCLUDE_TYPE_INFO, false );
         }
 
+        public Options withMapEntriesAsObjects()
+        {
+            return put( MAP_ENTRIES_AS_OBJECTS, true );
+        }
+
+        public Options withMapEntriesAsKeyValuePairs()
+        {
+            return put( MAP_ENTRIES_AS_OBJECTS, false );
+        }
+
         /**
          * Get Boolean option value.
          * @param option The option


Mime
View raw message