package com.bytedance.android.live_settings;

import X.M12;
import com.bytedance.android.live_settings.repo.SettingsRepo;
import com.bytedance.covode.number.Covode;

public final class SettingsValueProvider {
    public static final SettingsValueProvider INSTANCE = new SettingsValueProvider();

    private final boolean isSettingsSaving() {
        return SaveSettingsValue.isSaving;
    }

    public final void clear() {
        SettingsRepo.INSTANCE.clear();
    }

    static {
        Covode.recordClassIndex(11205);
    }

    public final boolean getBooleanValue(String str, boolean z) {
        M12.LIZ(str);
        if (isSettingsSaving()) {
            return z;
        }
        return SettingsRepo.INSTANCE.getBooleanValue(str, z);
    }

    public final double getDoubleValue(String str, double d) {
        M12.LIZ(str);
        if (isSettingsSaving()) {
            return d;
        }
        return SettingsRepo.INSTANCE.getDoubleValue(str, d);
    }

    public final float getFloatValue(String str, float f) {
        M12.LIZ(str);
        if (isSettingsSaving()) {
            return f;
        }
        return SettingsRepo.INSTANCE.getFloatValue(str, f);
    }

    public final int getIntValue(String str, int i) {
        M12.LIZ(str);
        if (isSettingsSaving()) {
            return i;
        }
        return SettingsRepo.INSTANCE.getIntValue(str, i);
    }

    public final long getLongValue(String str, long j) {
        M12.LIZ(str);
        if (isSettingsSaving()) {
            return j;
        }
        return SettingsRepo.INSTANCE.getLongValue(str, j);
    }

    public final String[] getStringArrayValue(String str, String[] strArr) {
        M12.LIZ(str);
        if (isSettingsSaving()) {
            return strArr;
        }
        return SettingsRepo.INSTANCE.getStringArrayValue(str, strArr);
    }

    public final String getStringValue(String str, String str2) {
        M12.LIZ(str);
        if (isSettingsSaving()) {
            return str2;
        }
        return SettingsRepo.INSTANCE.getStringValue(str, str2);
    }

    public final Object getValue(String str, Class<?> cls) {
        M12.LIZ(str, cls);
        if (isSettingsSaving()) {
            return null;
        }
        return SettingsRepo.INSTANCE.getValue(str, cls);
    }
}
