jena-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From a...@apache.org
Subject [04/15] jena git commit: Add pair(,)
Date Wed, 08 Feb 2017 12:50:12 GMT
Add pair(,)


Project: http://git-wip-us.apache.org/repos/asf/jena/repo
Commit: http://git-wip-us.apache.org/repos/asf/jena/commit/1085c89c
Tree: http://git-wip-us.apache.org/repos/asf/jena/tree/1085c89c
Diff: http://git-wip-us.apache.org/repos/asf/jena/diff/1085c89c

Branch: refs/heads/master
Commit: 1085c89c934e2a583363438635f5ec14958168db
Parents: 5ef2439
Author: Andy Seaborne <andy@apache.org>
Authored: Tue Jan 31 19:27:48 2017 +0000
Committer: Andy Seaborne <andy@apache.org>
Committed: Tue Jan 31 19:27:48 2017 +0000

----------------------------------------------------------------------
 .../org/apache/jena/atlas/json/JsonBuilder.java | 36 ++++++++++++++++++++
 1 file changed, 36 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/jena/blob/1085c89c/jena-arq/src/main/java/org/apache/jena/atlas/json/JsonBuilder.java
----------------------------------------------------------------------
diff --git a/jena-arq/src/main/java/org/apache/jena/atlas/json/JsonBuilder.java b/jena-arq/src/main/java/org/apache/jena/atlas/json/JsonBuilder.java
index d5f1ff1..7d2713f 100644
--- a/jena-arq/src/main/java/org/apache/jena/atlas/json/JsonBuilder.java
+++ b/jena-arq/src/main/java/org/apache/jena/atlas/json/JsonBuilder.java
@@ -116,6 +116,42 @@ public class JsonBuilder {
         return this ;
     }
 
+    public JsonBuilder pair(String key, JsonValue value) {
+        key(key);
+        value(value);
+        return this ;
+    }
+
+    public JsonBuilder pair(String key, boolean value) {
+        key(key);
+        value(value);
+        return this ;
+    }
+
+    public JsonBuilder pair(String key, BigDecimal value) {
+        key(key);
+        value(value);
+        return this ;
+    }
+
+    public JsonBuilder pair(String key, double value) {
+        key(key);
+        value(value);
+        return this ;
+    }
+
+    public JsonBuilder pair(String key, long value) {
+        key(key);
+        value(value);
+        return this ;
+    }
+
+    public JsonBuilder pair(String key, String value) {
+        key(key);
+        value(value);
+        return this ;
+    }
+
     public JsonBuilder key(String key) {
         State state = stack.peek() ;
         if ( state != State.OBJECT )


Mime
View raw message