Created
August 5, 2016 09:23
-
-
Save AlexBHarley/0c3fc7583c71a05e7a107a536f1802aa to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Given the following json object | |
JsonObject object = new JsonObject(); | |
object.addProperty( "firstName", "Homer" ); | |
object.addProperty( "lastName", "Simpson" ); | |
JsonObject object2 = new JsonObject(); | |
object2.addProperty( "name", "beer" ); | |
object2.addProperty( "colour", "dark" ); | |
object.add( "favouriteDrink", object2 ); | |
record.set(object); | |
// Now we set a new favouriteDrink | |
JsonObject object3 = new JsonObject(); | |
object3.addProperty( "name", "beer" ); | |
object3.addProperty( "colour", "light" ); | |
record.set( "favouriteDrink", object3 ); | |
// currently this is sent | |
// R|P|testRecord|2|favouriteDrink|O{"name":"beer","colour":"light"}+ | |
// would we rather have | |
// R|P|testRecord|2|favouriteDrink.colour|Slight+ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment