Skip to content

Instantly share code, notes, and snippets.

@mox601
Created January 27, 2017 13:39
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mox601/daebeda4f59dad7240f07125c18cc37d to your computer and use it in GitHub Desktop.
Save mox601/daebeda4f59dad7240f07125c18cc37d to your computer and use it in GitHub Desktop.
@Test
public void test() {
JSONObject root = new JSONObject("{}");
List<TestC> list = new ArrayList<>();
TestC testC = new TestC("type", "bucket", "code", null, DateTime.now(),
null);
TestC testC1 = new TestC("type", "bucket", "code", null, DateTime.now(),
null);
root.put("1", testC);
list.add(testC);
list.add(testC1);
root.put("2", list);
}
private static class TestC {
private final String type;
private final String bucket;
private final String code;
private final Object o;
private final DateTime now;
private final Object o1;
public TestC(String type, String bucket, String code, Object o, DateTime now, Object o1) {
this.type = type;
this.bucket = bucket;
this.code = code;
this.o = o;
this.now = now;
this.o1 = o1;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment