The most generic type I can think of in Java is a Map
to represent a JSON object and List
to represent an array of JSON objects.
It is very straight forward to parse this using the GSON library (I used version 2.2.4 at the time of writing):
import com.google.gson.Gson;
import java.util.List;
import java.util.Map;
public class Test {
public static void main(String[] args) {
String json = "{\"name\":\"a name\"}";
Gson GSON = new Gson();
Map parsed = GSON.fromJson(json, Map.class);
System.out.println(parsed.get("name"));
String jsonList = "[{\"name\":\"a name\"}, {\"name\":\"a name2\"}]";
List