Interface UserPreferenceManager


public interface UserPreferenceManager
This is a manager object that provides methods for working with a username cookie.

It can store and retrieve the username from the username cookie.

Since:
2.1.0
  • Method Summary Link icon

    Modifier and Type
    Method
    Description
    Retrieve the user's locale preferences, or null when no specific preferences were set.
    Retrieve the username from the username cookie.
    void
    Store the user's locale preferences.
    void
    saveUsername(String username)
    Store the username in the username cookie, to help users next time they reach the authenticator or form.
  • Method Details Link icon

    • saveUsername Link icon

      void saveUsername(String username)
      Store the username in the username cookie, to help users next time they reach the authenticator or form.
      Parameters:
      username - The username to store
    • getUsername Link icon

      @Nullable @Nullable String getUsername()
      Retrieve the username from the username cookie.

      Use this to pre-populate Templates with the last username the user entered on the site.

      Returns:
      String if the username exist in the cookie, null otherwise.
    • saveLocales Link icon

      void saveLocales(String locales)
      Store the user's locale preferences.
      Parameters:
      locales - space-separated list of BCP47 [RFC5646] language tag values, ordered by preference
      Since:
      2.2.0
    • getLocales Link icon

      @Nullable @Nullable String getLocales()
      Retrieve the user's locale preferences, or null when no specific preferences were set. The result is formatted as a space-separated list of BCP47 [RFC5646] language tag values, ordered by preference.
      Returns:
      String with language tag values, or or null if no preference was set
      Since:
      2.2.0