Interface IPreferences

    • Method Detail

      • get

        String get​(String key,
                   String def)
        Get settings value for a certain key and provide a default value.
        Parameters:
        key - the identifier for the setting
        def - the default value. For each call of get() with a given key, the default value must be the same. def may be null.
        Returns:
        the corresponding value if the property has been set before, def otherwise
      • get

        default String get​(String key)
        Get settings value for a certain key.
        Parameters:
        key - the identifier for the setting
        Returns:
        "" if there is nothing set for the preference key, the corresponding value otherwise. The result is not null.
      • put

        boolean put​(String key,
                    String value)
        Set a value for a certain setting.
        Parameters:
        key - the unique identifier for the setting
        value - the value of the setting. Can be null or "" which both removes the key-value entry.
        Returns:
        true, if something has changed (i.e. value is different than before)
      • getBoolean

        boolean getBoolean​(String key,
                           boolean def)
        Gets a boolean preference
        Parameters:
        key - The preference key
        def - The default value to use
        Returns:
        The boolean, false if it could not be parsed, the default value if it is unset
      • getBoolean

        default boolean getBoolean​(String key)
        Gets a boolean preference
        Parameters:
        key - The preference key
        Returns:
        The boolean or false if it could not be parsed
      • putBoolean

        boolean putBoolean​(String key,
                           boolean value)
        Set a boolean value for a certain setting.
        Parameters:
        key - the unique identifier for the setting
        value - The new value
        Returns:
        true, if something has changed (i.e. value is different than before)
        Since:
        12840
      • getInt

        int getInt​(String key,
                   int def)
        Gets an integer preference
        Parameters:
        key - The preference key
        def - The default value to use
        Returns:
        The integer
        Since:
        12840
      • putInt

        boolean putInt​(String key,
                       int value)
        Set an integer value for a certain setting.
        Parameters:
        key - the unique identifier for the setting
        value - The new value
        Returns:
        true, if something has changed (i.e. value is different than before)
        Since:
        12840
      • getLong

        long getLong​(String key,
                     long def)
        Gets a long preference
        Parameters:
        key - The preference key
        def - The default value to use
        Returns:
        The long value or the default value if it could not be parsed
      • putLong

        boolean putLong​(String key,
                        long value)
        Set a long value for a certain setting.
        Parameters:
        key - the unique identifier for the setting
        value - The new value
        Returns:
        true, if something has changed (i.e. value is different than before)
      • getDouble

        double getDouble​(String key,
                         double def)
        Gets a double preference
        Parameters:
        key - The preference key
        def - The default value to use
        Returns:
        The double value or the default value if it could not be parsed
      • putDouble

        boolean putDouble​(String key,
                          double value)
        Set a boolean value for a certain setting.
        Parameters:
        key - the unique identifier for the setting
        value - The new value
        Returns:
        true, if something has changed (i.e. value is different than before)
        Since:
        12840
      • getList

        List<StringgetList​(String key,
                             List<String> def)
        Get a list of values for a certain key
        Parameters:
        key - the identifier for the setting
        def - the default value.
        Returns:
        the corresponding value if the property has been set before, def otherwise
        Since:
        12840
      • getList

        default List<StringgetList​(String key)
        Get a list of values for a certain key
        Parameters:
        key - the identifier for the setting
        Returns:
        the corresponding value if the property has been set before, an empty list otherwise.
        Since:
        12840
      • putList

        boolean putList​(String key,
                        List<String> value)
        Set a list of values for a certain key.
        Parameters:
        key - the identifier for the setting
        value - The new value
        Returns:
        true, if something has changed (i.e. value is different than before)
        Since:
        12840
      • getListOfLists

        List<List<String>> getListOfLists​(String key,
                                          List<List<String>> def)
        Get an array of values (list of lists) for a certain key
        Parameters:
        key - the identifier for the setting
        def - the default value.
        Returns:
        the corresponding value if the property has been set before, def otherwise
        Since:
        12840
      • getListOfLists

        default List<List<String>> getListOfLists​(String key)
        Get an array of values (list of lists) for a certain key
        Parameters:
        key - the identifier for the setting
        Returns:
        the corresponding value if the property has been set before, an empty list otherwise
        Since:
        12840
      • putListOfLists

        boolean putListOfLists​(String key,
                               List<List<String>> value)
        Set an array of values (list of lists) for a certain key.
        Parameters:
        key - the identifier for the setting
        value - the new value
        Returns:
        true, if something has changed (i.e. value is different than before)
        Since:
        12840
      • getListOfMaps

        List<Map<String,​String>> getListOfMaps​(String key,
                                                     List<Map<String,​String>> def)
        Gets a list of key/value maps.
        Parameters:
        key - the key to search at
        def - the default value to use
        Returns:
        the corresponding value if the property has been set before, def otherwise
        Since:
        12840
      • getListOfMaps

        default List<Map<String,​String>> getListOfMaps​(String key)
        Gets a list of key/value maps.
        Parameters:
        key - the key to search at
        Returns:
        the corresponding value if the property has been set before, an empty list otherwise
        Since:
        12840
      • putListOfMaps

        boolean putListOfMaps​(String key,
                              List<Map<String,​String>> value)
        Set an a list of key/value maps.
        Parameters:
        key - the key to store the list in
        value - a list of key/value maps
        Returns:
        true if the value was changed
        Since:
        12840
      • getKeySet

        Set<StringgetKeySet()
        Get the set of all keys that are mapped to a value in this preferences.
        Returns:
        the set of all keys