package sttnf.app.nfkita.utils;

import android.content.SharedPreferences;
import android.preference.PreferenceManager;
import android.util.Log;

import sttnf.app.nfkita.NFKitaApplication;

/**
 * Created by isfaaghyth on 7/13/17.
 */

public class CacheManager {
    private static final String TAG = "CacheManager";

    private static SharedPreferences getPref() {
        return PreferenceManager.getDefaultSharedPreferences(NFKitaApplication.getContext());
    }

    public static void save(String key, String value) {
        Log.d(TAG, "saveCache: " + value);
        getPref().edit().putString(key, value).apply();
    }

    public static void save(String key, Boolean value) {
        Log.d(TAG, "saveCache: " + value);
        getPref().edit().putBoolean(key, value).apply();
    }

    public static Boolean checkExist(String key) {
        return getPref().contains(key);
    }

    public static String grabString(String key) {
        return getPref().getString(key, null);
    }

    public static Boolean grabBoolean(String key) {
        return getPref().getBoolean(key, false);
    }
}

@@ -522,51 +522,8 @@
 ) %7B%0A
-        Log.d(TAG, %22saveCache: %22 + value);%0A
     
@@ -642,51 +642,8 @@
 ) %7B%0A
-        Log.d(TAG, %22saveCache: %22 + value);%0A
     

remove logcat for local storage