<commit_before>package com.carloseduardo.preferences.manager;

import android.content.Context;
import android.content.SharedPreferences;

import java.util.Date;

public class PreferencesImpl implements Preferences {

    private final SharedPreferences preferences;

    public PreferencesImpl(Context context) {

        String sharedPreferencesName = "globalPrefs";
        preferences = context.getSharedPreferences(sharedPreferencesName, Context.MODE_PRIVATE);
    }

    @Override
    public String getString(String key) {
        return preferences.getString(key, "");
    }

    @Override
    public int getInt(String key) {
        return preferences.getInt(key, 0);
    }

    @Override
    public long getLong(String key) {
        return preferences.getLong(key, 0);
    }

    @Override
    public float getFloat(String key) {
        return preferences.getFloat(key, 0);
    }

    @Override
    public double getDouble(String key) {
        return Double.doubleToLongBits(getLong(key));
    }

    @Override
    public boolean getBoolean(String key) {
        return preferences.getBoolean(key, false);
    }

    @Override
    public Date getDate(String key) {
        long dateInMillis = preferences.getLong(key, 0);
        return dateInMillis == 0 ? null : new Date(dateInMillis);
    }

    @Override
    public void putString(String key, String value) {
        preferences.edit().putString(key, value).apply();
    }

    @Override
    public void putInt(String key, int value) {
        preferences.edit().putInt(key, value).apply();
    }<commit_msg>Implements string set methods<commit_after>package com.carloseduardo.preferences.manager;

import android.content.Context;
import android.content.SharedPreferences;

import java.util.Date;
import java.util.HashSet;
import java.util.Set;

public class PreferencesImpl implements Preferences {

    private final SharedPreferences preferences;

    public PreferencesImpl(Context context) {

        String sharedPreferencesName = "globalPrefs";
        preferences = context.getSharedPreferences(sharedPreferencesName, Context.MODE_PRIVATE);
    }

    @Override
    public String getString(String key) {
        return preferences.getString(key, "");
    }

    @Override
    public int getInt(String key) {
        return preferences.getInt(key, 0);
    }

    @Override
    public long getLong(String key) {
        return preferences.getLong(key, 0);
    }

    @Override
    public float getFloat(String key) {
        return preferences.getFloat(key, 0);
    }

    @Override
    public double getDouble(String key) {
        return Double.doubleToLongBits(getLong(key));
    }

    @Override
    public Set<String> getStringSet(String key) {
        return preferences.getStringSet(key, new HashSet<>());
    }

    @Override
    public boolean getBoolean(String key) {
        return preferences.getBoolean(key, false);
    }

    @Override
    public Date getDate(String key) {
        long dateInMillis = preferences.getLong(key, 0);
        return dateInMillis == 0 ? null : new Date(dateInMillis);
    }

    @Override
    public void putString(String key, String value) {
        preferences.edit().putString(key, value).apply();
    }

    @Override
    public void putStringSet(String set, Set<String> value) {
        preferences.edit().putStringSet(set, value).apply();
    }

    @Override
    public void putInt(String key, int value) {
        preferences.edit().putInt(key, value).apply();
    }
{'fraction_non_alphanumeric': 0.09661697247706422, 'fraction_numerical': 0.0028669724770642203, 'mean_word_length': 3.085480093676815, 'pattern_counts': {'":': 0, '<': 6, '<?xml version=': 0, '>': 6, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3229392', 'n_tokens_mistral': 976, 'n_tokens_neox': 953, 'n_words': 235}