package com.gh.gamecenter.room.converter;

import androidx.room.TypeConverter;

import com.gh.gamecenter.core.utils.GsonUtils;

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

/**
 * Created by khy on 18/04/18.
 */

public class ListStringConverter {
    @TypeConverter
    public static String toListString(List<String> data) {
        return GsonUtils.getGson().toJson(data);
    }

    @TypeConverter
    public static List<String> toList(String token) {
        return GsonUtils.getGson().fromJson(token, ArrayList.class);
    }
}
