public static Shop getInstance(Context context) { String defValue = ""; String string = SPUtil.getString(context, Constants.SP_SHOP, Constants.SP_SHOP, defValue); Shop bean = string.equals(defValue) ? null : MyGson.getInstance().fromJson(string, Shop.class); return bean; }
/** "seaRecordId": 1 */ public boolean saveInstance(Context context) { String spString = MyGson.getInstance().toJson(this); return SPUtil.saveString(context, Constants.SP_SHOP, Constants.SP_SHOP, spString); }