package com.android.launcher3.settings.wifi;

import android.content.Context;
import android.text.TextUtils;

import com.google.gson.Gson;
import com.google.gson.reflect.TypeToken;
import com.secspace.lib.common.utils.Prefs;

import java.util.ArrayList;
import java.util.List;

public class Gson2ListHelper {
    public static List<WifiInfoBean> stringWifiWhite2List(Context context) {
        List<WifiInfoBean> wifiInfos = new ArrayList<>();
        String wifiWhiteList = Prefs.getWifiWhiteList(context);
        if (TextUtils.isEmpty(wifiWhiteList)) {
            return wifiInfos;
        }
        Gson gson = new Gson();
        wifiInfos = gson.fromJson(wifiWhiteList, new TypeToken<List<WifiInfoBean>>() {
        }.getType());
        return wifiInfos;
    }
}
