Examples of Gson


Examples of com.google.gson.Gson

        final Relationship rel = rootNode.createRelationshipTo(n1, DynamicRelationshipType.withName("REL"));
        rel.setProperty("name","rel1");
        final CypherQueryExecutor.CypherResult result = cypherQueryExecutor.cypherQuery("start n=node("+rootNode.getId()+") match p=n-[r]->m return p,n,r,m", null);
        System.out.println(result);
        final List<Map<String,Object>> json = result.getJson();
        System.out.println(new Gson().toJson(json));
        assertEquals(1, json.size());
        final Map<String, Object> row = json.get(0);
        assertEquals(4, row.size());
        final Map node1 = (Map) row.get("n");
        assertEquals(1, node1.size());
View Full Code Here

Examples of com.google.gson.Gson

    @Test
    public void testMergeGeoff() throws Exception {
        final Map map = neo4jService.mergeGeoff("(0) {\"foo\":\"bar\"}");
        assertEquals(MapUtil.map("foo", "bar"),map.get("(0)"));
        assertEquals("{\"(0)\":{\"foo\":\"bar\"}}",new Gson().toJson(map));
    }
View Full Code Here

Examples of com.google.gson.Gson

  }


  public IString toJSON(IValue value) {
    IValueAdapter adap = new IValueAdapter();
    Gson gson = new GsonBuilder()
    .registerTypeAdapter(IValue.class, adap)
    .enableComplexMapKeySerialization()
    .setDateFormat(DateFormat.LONG)
    .setFieldNamingPolicy(FieldNamingPolicy.UPPER_CAMEL_CASE)
    .setVersion(1.0)
    .create();
    try {
      String json = gson.toJson(value, new TypeToken<IValue>() {}.getType());
      return values.string(json);
    } catch (Exception e) {
      throw RuntimeExceptionFactory.io(values.string(e.getMessage()), null, null);
    }
  }
View Full Code Here

Examples of com.massivecraft.mcore.xlib.gson.Gson

    factories.addAll(this.factories);
    Collections.reverse(factories);
    factories.addAll(this.hierarchyFactories);
    addTypeAdaptersForDate(datePattern, dateStyle, timeStyle, factories);

    return new Gson(excluder, fieldNamingPolicy, instanceCreators,
        serializeNulls, complexMapKeySerialization,
        generateNonExecutableJson, escapeHtmlChars, prettyPrinting,
        serializeSpecialFloatingPointValues, longSerializationPolicy, factories);
  }
View Full Code Here

Examples of gherkin.deps.com.google.gson.Gson

                "      \"a_byte\":5\n" +
                "    }\n" +
                "  ]\n" +
                "}\n";

        Gson gson = new Gson();
        String actual = gson.toJson(map);
        assertEquals(gson.fromJson(new StringReader(expected), Map.class), gson.fromJson(new StringReader(actual), Map.class));
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.