How to convert json array to java Object

Use com.amazonaws.util.json.Jackson

import com.amazonaws.util.json.Jackson;
import java.util.ArrayList;
import lombok.Data;

class DeviceList {
  private ArrayList<String> devices;

DeviceList deviceList = Jackson.fromJsonString("{\"devices\":[\"Mobile\", \"Desktop\"]}", DeviceList.class);

Subscribe to Post, Code and Quiet Time.

Don’t miss out on the latest issues. Sign up now to get access to the library of members-only issues.