Interface NamedCollection

    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class Description
    • Field Summary

      Fields 
      Modifier and Type Field Description
    • Constructor Summary

      Constructors 
      Constructor Description
    • Enum Constant Summary

      Enum Constants 
      Enum Constant Description
    • Method Summary

      Modifier and Type Method Description
      abstract void setInt(String key, int value) Set or update an int value
      abstract int getInt(String key, int defaultValue) Get int value for key
      abstract void setString(String key, String value) Set or update a String value for key
      abstract String getString(String key, String defaultValue) Get String value for key
      abstract void setDouble(String key, double value) Set or update a double value for key
      abstract double getDouble(String key, double defaultValue) Get double value for key
      abstract void setLong(String key, long value) Set or update a long value for key
      abstract long getLong(String key, long defaultValue) Get long value for key
      abstract void setFloat(String key, float value) Set or update a float value for key
      abstract float getFloat(String key, float defaultValue) Get float value for key
      abstract void setBoolean(String key, boolean value) Set or update a boolean value for key
      abstract boolean getBoolean(String key, boolean defaultValue) Get boolean value for key
      abstract void setMap(String key, Map<String, String> value) Set or update a Map value for key
      abstract Map<String, String> getMap(String key) Get Map value for key
      abstract boolean contains(String key) Check if the named collection contains key
      abstract void remove(String key) Remove persisted value for key
      abstract void removeAll() Remove all key-value pairs from this named collection
      • Methods inherited from class java.lang.Object

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

    • Method Detail

      • setInt

         abstract void setInt(String key, int value)

        Set or update an int value

        Parameters:
        key - String key name
        value - int value
      • getInt

         abstract int getInt(String key, int defaultValue)

        Get int value for key

        Parameters:
        key - String key name
        defaultValue - int the default value to return if key does not exist
        Returns:

        persisted value if it exists, defaultValue otherwise

      • setString

         abstract void setString(String key, String value)

        Set or update a String value for key

        Parameters:
        key - String key name
        value - String the default value to return if key does not exist
      • getString

         abstract String getString(String key, String defaultValue)

        Get String value for key

        Parameters:
        key - String key name
        defaultValue - String the default value to return if key does not exist
        Returns:

        persisted value if it exists, defaultValue otherwise

      • setDouble

         abstract void setDouble(String key, double value)

        Set or update a double value for key

        Parameters:
        key - String key name
        value - double the default value to return if key does not exist
      • getDouble

         abstract double getDouble(String key, double defaultValue)

        Get double value for key

        Parameters:
        key - String key name
        defaultValue - double the default value to return if key does not exist
        Returns:

        persisted value if it exists, defaultValue otherwise

      • setLong

         abstract void setLong(String key, long value)

        Set or update a long value for key

        Parameters:
        key - String key name
        value - long the default value to return if key does not exist
      • getLong

         abstract long getLong(String key, long defaultValue)

        Get long value for key

        Parameters:
        key - String key name
        defaultValue - long the default value to return if key does not exist
        Returns:

        persisted value if it exists, defaultValue otherwise

      • setFloat

         abstract void setFloat(String key, float value)

        Set or update a float value for key

        Parameters:
        key - String key name
        value - float the default value to return if key does not exist
      • getFloat

         abstract float getFloat(String key, float defaultValue)

        Get float value for key

        Parameters:
        key - String key name
        defaultValue - float the default value to return if key does not exist
        Returns:

        persisted value if it exists, defaultValue otherwise

      • setBoolean

         abstract void setBoolean(String key, boolean value)

        Set or update a boolean value for key

        Parameters:
        key - String key name
        value - boolean the default value to return if key does not exist
      • getBoolean

         abstract boolean getBoolean(String key, boolean defaultValue)

        Get boolean value for key

        Parameters:
        key - String key name
        defaultValue - boolean the default value to return if key does not exist
        Returns:

        persisted value if it exists, defaultValue otherwise

      • setMap

         abstract void setMap(String key, Map<String, String> value)

        Set or update a Map value for key

        Parameters:
        key - String key name
        value - Map the default value to return if key does not exist
      • getMap

         abstract Map<String, String> getMap(String key)

        Get Map value for key

        Parameters:
        key - String key name
        Returns:

        persisted value if it exists, null otherwise

      • contains

         abstract boolean contains(String key)

        Check if the named collection contains key

        Parameters:
        key - String key name
        Returns:

        true if key exists, false otherwise

      • remove

         abstract void remove(String key)

        Remove persisted value for key

        Parameters:
        key - String key name
      • removeAll

         abstract void removeAll()

        Remove all key-value pairs from this named collection