Stay organized with collections
Save and categorize content based on your preferences.
PreferencesFactory
interface PreferencesFactory
A factory object that generates Preferences objects. Providers of new Preferences
implementations should provide corresponding PreferencesFactory implementations so that the new Preferences implementation can be installed in place of the platform-specific default implementation.
This class is for Preferences implementers only. Normal users of the Preferences facility should have no need to consult this documentation.
Summary
Public methods |
abstract Preferences! |
Returns the system root preference node.
|
abstract Preferences! |
Returns the user root preference node corresponding to the calling user.
|
Public methods
systemRoot
abstract fun systemRoot(): Preferences!
Returns the system root preference node. (Multiple calls on this method will return the same object reference.)
userRoot
abstract fun userRoot(): Preferences!
Returns the user root preference node corresponding to the calling user. In a server, the returned value will typically depend on some implicit client-context.
Return |
Preferences! |
the user root preference node corresponding to the calling user |
Content and code samples on this page are subject to the licenses described in the Content License. Java and OpenJDK are trademarks or registered trademarks of Oracle and/or its affiliates.
Last updated 2025-02-10 UTC.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-02-10 UTC."],[],[],null,["# PreferencesFactory\n\nAdded in [API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)\n\nPreferencesFactory\n==================\n\n```\ninterface PreferencesFactory\n```\n\n|-----------------------------------------|\n| [java.util.prefs.PreferencesFactory](#) |\n\nA factory object that generates Preferences objects. Providers of new [Preferences](/reference/kotlin/java/util/prefs/Preferences) implementations should provide corresponding PreferencesFactory implementations so that the new Preferences implementation can be installed in place of the platform-specific default implementation.\n\n**This class is for Preferences implementers only. Normal users of the Preferences facility should have no need to consult this documentation.**\n\nSummary\n-------\n\n| Public methods ||\n|------------------------------------------------------------------------|------------------------------------------------------------------------------------------------------|\n| abstract [Preferences](/reference/kotlin/java/util/prefs/Preferences)! | [systemRoot](#systemRoot())`()` Returns the system root preference node. |\n| abstract [Preferences](/reference/kotlin/java/util/prefs/Preferences)! | [userRoot](#userRoot())`()` Returns the user root preference node corresponding to the calling user. |\n\nPublic methods\n--------------\n\n### systemRoot\n\nAdded in [API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \n\n```\nabstract fun systemRoot(): Preferences!\n```\n\nReturns the system root preference node. (Multiple calls on this method will return the same object reference.)\n\n| Return ||\n|---------------------------------------------------------------|---------------------------------|\n| [Preferences](/reference/kotlin/java/util/prefs/Preferences)! | the system root preference node |\n\n### userRoot\n\nAdded in [API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \n\n```\nabstract fun userRoot(): Preferences!\n```\n\nReturns the user root preference node corresponding to the calling user. In a server, the returned value will typically depend on some implicit client-context.\n\n| Return ||\n|---------------------------------------------------------------|-----------------------------------------------------------------|\n| [Preferences](/reference/kotlin/java/util/prefs/Preferences)! | the user root preference node corresponding to the calling user |"]]