Class UserPreferences

java.lang.Object
org.episteme.core.io.UserPreferences

public class UserPreferences extends Object
User preferences manager with file-based persistence. Stores user preferences in the user's home directory.
Since:
1.0
Author:
Silvere Martin-Michiellot, Gemini AI (Google DeepMind)
  • Field Details

  • Method Details

    • getInstance

      public static UserPreferences getInstance()
    • get

      public String get(String key)
      Gets a preference value.
    • get

      public String get(String key, String defaultValue)
      Gets a preference value with default.
    • set

      public void set(String key, String value)
      Sets a preference value and saves immediately.
    • getPreferredBackend

      public String getPreferredBackend(String backendType)
      Gets the preferred backend for a given type.
    • setPreferredBackend

      public void setPreferredBackend(String backendType, String backendId)
      Sets the preferred backend for a given type.
    • getInt

      public int getInt(String key, int defaultValue)
      Gets an integer preference value with default.
    • setInt

      public void setInt(String key, int value)
      Sets an integer preference value.
    • save

      public void save()
      Saves preferences to file.
    • getPreferencesPath

      public Path getPreferencesPath()
      Returns the path to the preferences file.
    • getLanguage

      public String getLanguage()
      Gets the UI language (default from episteme.properties).
    • setLanguage

      public void setLanguage(String language)
      Sets the UI language.
    • getTheme

      public String getTheme()
      Gets the UI theme (default from episteme.properties).
    • setTheme

      public void setTheme(String theme)
      Sets the UI theme.
    • getComputeBackend

      public String getComputeBackend()
      Gets the compute backend (cpu, opencl, cuda).
    • setComputeBackend

      public void setComputeBackend(String backend)
      Sets the compute backend.
    • getComputeThreads

      public int getComputeThreads()
      Gets the number of compute threads.
    • setComputeThreads

      public void setComputeThreads(int threads)
      Sets the number of compute threads.
    • isGpuEnabled

      public boolean isGpuEnabled()
      Gets whether GPU compute is enabled.
    • setGpuEnabled

      public void setGpuEnabled(boolean enabled)
      Sets whether GPU compute is enabled.
    • getPreferencesMap

      public Map<String,String> getPreferencesMap()
      Gets a read-only view of all persistent preferences.
    • getAutoTuningMode

      public String getAutoTuningMode()
      Gets the auto-tuning mode (ON, OFF, AUTO).
    • setAutoTuningMode

      public void setAutoTuningMode(String mode)
      Sets the auto-tuning mode.
    • isBackendDeactivated

      public boolean isBackendDeactivated(String id)
      Checks if a backend is manually deactivated.
    • setBackendDeactivated

      public void setBackendDeactivated(String id, boolean deactivate)
      Sets whether a backend is manually deactivated.
    • isAutoTuningEnabled

      public boolean isAutoTuningEnabled()
      Gets whether auto-tuning is enabled.
    • setAutoTuningEnabled

      public void setAutoTuningEnabled(boolean enabled)
      Sets whether auto-tuning is enabled.