Skip to content

Instantly share code, notes, and snippets.

@AlexBHarley
Created August 5, 2016 09:23
Show Gist options
  • Save AlexBHarley/0c3fc7583c71a05e7a107a536f1802aa to your computer and use it in GitHub Desktop.
Save AlexBHarley/0c3fc7583c71a05e7a107a536f1802aa to your computer and use it in GitHub Desktop.
// 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