package com.gh.gamecenter.room.converter;

import androidx.room.TypeConverter;

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

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

public class AnswerUserConverter {
    @TypeConverter
    public static String toUserEntityString(UserEntity data) {
        return GsonUtils.getGson().toJson(data);
    }

    @TypeConverter
    public static UserEntity toUserEntity(String token) {
        return GsonUtils.getGson().fromJson(token, UserEntity.class);
    }
}
