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;

@Data
class DeviceList {
  private ArrayList<String> devices;
}

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

2 comments:

  1. If you're trying hard to lose weight then you have to get on this totally brand new custom keto diet.

    To produce this keto diet, certified nutritionists, personal trainers, and professional cooks have joined together to provide keto meal plans that are productive, convenient, price-efficient, and enjoyable.

    From their launch in 2019, 1000's of people have already transformed their body and health with the benefits a proper keto diet can give.

    Speaking of benefits: in this link, you'll discover eight scientifically-confirmed ones given by the keto diet.

    ReplyDelete

How to Set Up Giscus Comments for Your Website

  How to Set Up Giscus Comments for Your Website If you want to add a clean, GitHub-powered comment system to your website,   Giscus   is on...