Package com.io7m.cardant.client.preferences.vanilla

# Class CAPreferencesService

java.lang.Object
com.io7m.cardant.client.preferences.vanilla.CAPreferencesService

All Implemented Interfaces:
  `CAPreferencesServiceType`, `com.io7m.repetoir.core.RPServiceType`

public final class CAPreferencesService extends Object implements CAPreferencesServiceType
The default preferences service.

- ## Method Summary

  Modifier and Type
  Method
  Description
  `String`
  `description()`
  `static CAPreferencesServiceType`
  `openOrDefault(Path file)`
  Open preferences or return the default preferences values.
  `CAPreferences`
  `preferences()`
  `void`
  `save(CAPreferences newPreferences)`
  Save preferences to persistent storage.
  `String`
  `toString()`

  ### Methods inherited from class java.lang.Object

  `clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

  ### Methods inherited from interface com.io7m.cardant.client.preferences.api.CAPreferencesServiceType

  `addRecentFile, update`

- ## Method Details

  - ### openOrDefault

    public static CAPreferencesServiceType openOrDefault(Path file) throws IOException
    Open preferences or return the default preferences values.
    Parameters:
      `file` - The preferences file
    Returns:
      A preferences service
    Throws:
      `IOException` - On I/O errors

  - ### preferences

    public CAPreferences preferences()
    Specified by:
      `preferences` in interface `CAPreferencesServiceType`
    Returns:
      The current preferences

  - ### save

    public void save(CAPreferences newPreferences) throws IOException
    Description copied from interface: `CAPreferencesServiceType`
    Save preferences to persistent storage.
    Specified by:
      `save` in interface `CAPreferencesServiceType`
    Parameters:
      `newPreferences` - The new preferences
    Throws:
      `IOException` - On I/O errors

  - ### toString

    public String toString()
    Overrides:
      `toString` in class `Object`

  - ### description

    public String description()
    Specified by:
      `description` in interface `com.io7m.repetoir.core.RPServiceType`