Module de.carne

Class IntPreference


  • public class IntPreference
    extends Preference<@NonNull java.lang.Integer>
    Integer preference access.
    • Constructor Summary

      Constructors 
      Constructor Description
      IntPreference​(java.lang.String key, int defaultValue)
      Constructs a new IntPreference instance.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      java.lang.Integer get​(java.util.prefs.Preferences prefs, java.lang.Integer def)
      Gets this instance's preference value.
      int getInt​(java.util.prefs.Preferences prefs)
      Gets this instance's preference value.
      int getInt​(java.util.prefs.Preferences prefs, int def)
      Gets this instance's preference value.
      void put​(java.util.prefs.Preferences prefs, java.lang.Integer value)
      Sets this instance's preference value.
      void putInt​(java.util.prefs.Preferences prefs, int value)
      Sets this instance's preference value.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • IntPreference

        public IntPreference​(java.lang.String key,
                             int defaultValue)
        Constructs a new IntPreference instance.
        Parameters:
        key - the preference key to access.
        defaultValue - the default preference value to use.
    • Method Detail

      • get

        public java.lang.Integer get​(java.util.prefs.Preferences prefs,
                                     java.lang.Integer def)
        Description copied from class: Preference
        Gets this instance's preference value.
        Specified by:
        get in class Preference<@NonNull java.lang.Integer>
        Parameters:
        prefs - the Preferences object to get the value from.
        def - the default preference value to return in case the preference is not defined.
        Returns:
        the retrieved preference value.
      • put

        public void put​(java.util.prefs.Preferences prefs,
                        java.lang.Integer value)
        Description copied from class: Preference
        Sets this instance's preference value.
        Specified by:
        put in class Preference<@NonNull java.lang.Integer>
        Parameters:
        prefs - the Preferences object to set the value into.
        value - the preference value to set.
      • getInt

        public int getInt​(java.util.prefs.Preferences prefs)
        Gets this instance's preference value.
        Parameters:
        prefs - the Preferences object to get the value from.
        Returns:
        the retrieved preference value.
      • getInt

        public int getInt​(java.util.prefs.Preferences prefs,
                          int def)
        Gets this instance's preference value.
        Parameters:
        prefs - the Preferences object to get the value from.
        def - the default preference value to return in case the preference is not defined.
        Returns:
        the retrieved preference value.
      • putInt

        public void putInt​(java.util.prefs.Preferences prefs,
                           int value)
        Sets this instance's preference value.
        Parameters:
        prefs - the Preferences object to set the value into.
        value - the preference value to set.