Class GeckoPreferenceController.GeckoPreference<T>

Object
org.mozilla.geckoview.GeckoPreferenceController.GeckoPreference<T>
Type Parameters:
T - The type of the preference.
Enclosing class:
GeckoPreferenceController

public static class GeckoPreferenceController.GeckoPreference<T> extends Object
This object represents information on a GeckoPreference.
  • Field Details

    • pref

      @NonNull public final String pref
      The Gecko preference name. (e.g., "some.pref.item")
    • type

      public final int type
      The Gecko type of preference. (e.g., "PREF_BOOL" or "PREF_STRING" or "PREF_INT")
    • defaultValue

      @Nullable public final T defaultValue
      The default value of the preference. Corresponds to the default branch's value.
    • userValue

      @Nullable public final T userValue
      The user value of the preference. Corresponds to the user branch's value.
  • Method Details

    • getValue

      @AnyThread @Nullable public T getValue()
      The current value of the preference that is in operation.
      Returns:
      Will return the user value if set, if not then the default value.
    • getHasUserChangedValue

      @AnyThread public boolean getHasUserChangedValue()
      Checks to see if the user value has changed from the default value.
      Returns:
      Whether the user value has diverged from the default value.
    • toString

      @NonNull public String toString()
      Convenience method to format the GeckoPreference object into a string.
      Overrides:
      toString in class Object
      Returns:
      String representing GeckoPreference.