Class DefaultPrefService

    • Constructor Detail

      • DefaultPrefService

        public DefaultPrefService()
    • Method Detail

      • get

        public String get​(Class<?> c,
                          String name,
                          String defaultValue)
        Description copied from interface: PrefService
        Gets a persisted key as a String.
        Parameters:
        c - The class with which the key is associated.
        name - The key to retrieve.
        defaultValue - The value to return if the key is not present.
        Returns:
        The value of the key as a String.
      • getBoolean

        public boolean getBoolean​(Class<?> c,
                                  String name,
                                  boolean defaultValue)
        Description copied from interface: PrefService
        Gets a persisted key as a boolean.
        Parameters:
        c - The class with which the key is associated.
        name - The key to retrieve.
        defaultValue - The value to return if the key is not present.
        Returns:
        The value of the key as a boolean.
      • getDouble

        public double getDouble​(Class<?> c,
                                String name,
                                double defaultValue)
        Description copied from interface: PrefService
        Gets a persisted key as a double.
        Parameters:
        c - The class with which the key is associated.
        name - The key to retrieve.
        defaultValue - The value to return if the key is not present.
        Returns:
        The value of the key as a double.
      • getFloat

        public float getFloat​(Class<?> c,
                              String name,
                              float defaultValue)
        Description copied from interface: PrefService
        Gets a persisted key as a float.
        Parameters:
        c - The class with which the key is associated.
        name - The key to retrieve.
        defaultValue - The value to return if the key is not present.
        Returns:
        The value of the key as a float.
      • getInt

        public int getInt​(Class<?> c,
                          String name,
                          int defaultValue)
        Description copied from interface: PrefService
        Gets a persisted key as an int.
        Parameters:
        c - The class with which the key is associated.
        name - The key to retrieve.
        defaultValue - The value to return if the key is not present.
        Returns:
        The value of the key as an int.
      • getLong

        public long getLong​(Class<?> c,
                            String name,
                            long defaultValue)
        Description copied from interface: PrefService
        Gets a persisted key as a long.
        Parameters:
        c - The class with which the key is associated.
        name - The key to retrieve.
        defaultValue - The value to return if the key is not present.
        Returns:
        The value of the key as an long.
      • getMap

        public Map<String,​String> getMap​(Class<?> c,
                                               String name)
        Description copied from interface: PrefService
        Gets a persisted key as a Map.
        Parameters:
        c - The class with which the key is associated.
        name - The key to retrieve.
        Returns:
        The value of the key as an Map, or null if the key is not present.
      • getList

        public List<String> getList​(Class<?> c,
                                    String name)
        Description copied from interface: PrefService
        Gets a persisted key as a List.
        Parameters:
        c - The class with which the key is associated.
        name - The key to retrieve.
        Returns:
        The value of the key as an List, or null if the key is not present.
      • put

        public void put​(Class<?> c,
                        String name,
                        boolean value)
        Description copied from interface: PrefService
        Saves a key/value pair in persistent storage.
        Parameters:
        c - The class with which the key/value pair is associated.
        name - The key where the value should be stored.
        value - The value to store.
        See Also:
        PrefService.getBoolean(Class, String, boolean)
      • put

        public void put​(Class<?> c,
                        String name,
                        double value)
        Description copied from interface: PrefService
        Saves a key/value pair in persistent storage.
        Parameters:
        c - The class with which the key/value pair is associated.
        name - The key where the value should be stored.
        value - The value to store.
        See Also:
        PrefService.getDouble(Class, String, double)
      • put

        public void put​(Class<?> c,
                        String name,
                        float value)
        Description copied from interface: PrefService
        Saves a key/value pair in persistent storage.
        Parameters:
        c - The class with which the key/value pair is associated.
        name - The key where the value should be stored.
        value - The value to store.
        See Also:
        PrefService.getFloat(Class, String, float)
      • put

        public void put​(Class<?> c,
                        String name,
                        int value)
        Description copied from interface: PrefService
        Saves a key/value pair in persistent storage.
        Parameters:
        c - The class with which the key/value pair is associated.
        name - The key where the value should be stored.
        value - The value to store.
        See Also:
        PrefService.getInt(Class, String, int)
      • put

        public void put​(Class<?> c,
                        String name,
                        long value)
        Description copied from interface: PrefService
        Saves a key/value pair in persistent storage.
        Parameters:
        c - The class with which the key/value pair is associated.
        name - The key where the value should be stored.
        value - The value to store.
        See Also:
        PrefService.getLong(Class, String, long)
      • put

        public void put​(Class<?> c,
                        String name,
                        Map<String,​String> value)
        Description copied from interface: PrefService
        Saves a key/value pair in persistent storage.
        Parameters:
        c - The class with which the key/value pair is associated.
        name - The key where the value should be stored.
        value - The value to store.
        See Also:
        PrefService.getMap(Class, String)
      • put

        public void put​(Class<?> c,
                        String name,
                        Iterable<String> value)
        Description copied from interface: PrefService
        Saves a key/value pair in persistent storage.
        Parameters:
        c - The class with which the key/value pair is associated.
        name - The key where the value should be stored.
        value - The value to store.
        See Also:
        PrefService.getList(Class, String)
      • remove

        public void remove​(Class<?> c,
                           String name)
        Description copied from interface: PrefService
        Deletes a key from persistent storage.
        Parameters:
        c - The class with which the key is associated.
        name - The key to remove.
      • clear

        public void clear​(Class<?> c)
        Description copied from interface: PrefService
        Deletes all of the given Class's keys from persistent storage.
        Parameters:
        c - The class whose keys should be removed.
      • clearAll

        public void clearAll()
        Description copied from interface: PrefService
        Deletes all information from the data store. Use with care!