# Interface CAPreferencesServiceType

All Superinterfaces:
  `com.io7m.repetoir.core.RPServiceType`

All Known Implementing Classes:
  `CAPreferencesService`

public interface CAPreferencesServiceType extends com.io7m.repetoir.core.RPServiceType
The preferences service.

- ## Method Summary

  Modifier and Type
  Method
  Description
  `default Path`
  `addRecentFile(Path file)`
  Add a recent file to the current preferences.
  `CAPreferences`
  `preferences()`
  `void`
  `save(CAPreferences newPreferences)`
  Save preferences to persistent storage.
  `default void`
  `update(Function<CAPreferences, CAPreferences> updater)`
  Update the current preferences.

  ### Methods inherited from interface com.io7m.repetoir.core.RPServiceType

  `description`

- ## Method Details

  - ### preferences

    CAPreferences preferences()
    Returns:
      The current preferences

  - ### save

    void save(CAPreferences newPreferences) throws IOException
    Save preferences to persistent storage.
    Parameters:
      `newPreferences` - The new preferences
    Throws:
      `IOException` - On I/O errors

  - ### update

    default void update(Function<CAPreferences, CAPreferences> updater) throws IOException
    Update the current preferences.
    Parameters:
      `updater` - The updater function
    Throws:
      `IOException` - On I/O errors

  - ### addRecentFile

    default Path addRecentFile(Path file) throws IOException
    Add a recent file to the current preferences.
    Parameters:
      `file` - The file
    Returns:
      `file`
    Throws:
      `IOException` - On I/O errors