I need to create a data structure that is of the following syntax:
[
status: "success",
statusDescription: "statusDescription"
count: "5",
states: [
[stateId: "1", stateDescription: "1 description"],
[stateId: "2", stateDescription: "2 description"],
[stateId: "3", stateDescription: "3 description"],
[stateId: "4", stateDescription: "4 description"],
[stateId: "5", stateDescription: "5 description"]
]
]
I’m not sure how to do that in Java. I’m trying various combinations of ArrayLists and Maps, but can’t quite get it.
EDIT: I actually need to return this data type as a response to a JAX-WS @WebMethod call. Creating a separate class, especially one with a List element is causing problems.
Build your own class. Please.