I have following json in String format. How to convert it to a java object?

**JSON Srting**

```
String allCameraList =   [{
    "name": "Camera1",
    "displayURL": "Stream-1"
}, {
    "name": "Camera2",
    "displayURL": "Stream-3"
}, {
    "name": "Camera4",
    "displayURL": "Stream-7"
}, {
    "name": "Camera3",
    "displayURL": "Stream-5"
}, {
    "name": "Camera5",
    "displayURL": "Stream-10"
}, {
    "name": "Camera6",
    "displayURL": "Stream-12"
}]

```

**Java Entity class**

```
public class CameraDetails
{
    private String name;
    private String displayURL;

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getDisplayURL() {
        return displayURL;
    }

    public void setDisplayURL(String displayURL) {
        this.displayURL = displayURL;
    }}

```

When I tried to use Json parser like following:

```
 JsonParser parser = new JsonParser();
    String json = parser.parse(allCameraList)
            .getAsJsonObject()
            .getAsJsonObject("name")
            .toString();

```

it threw the following exception:

```
java.lang.IllegalStateException: Not a JSON Object

```

Please note that my json string is start with `[` not with `{`.