Code example for JsonArray

Methods: add

0
        ImmutableSet.of("q")); 
 
    JsonObject labels = new JsonObject();
    labels.addProperty("Verified", "-1");
    labels.addProperty("Code-Review", "2");
    JsonArray list = new JsonArray();
    list.add(new JsonPrimitive("a"));
    list.add(new JsonPrimitive("b"));
    JsonObject exp = new JsonObject();
    exp.addProperty("message", "this.is.text");
    exp.add("labels", labels);
    exp.add("a_list", list);
 
    assertEquals(exp, obj);
  } 
} 
Contextual code suggestions in your IDE  Get Codota for Java