org.salespointframework.core
Interface PreferenceStorage

All Known Implementing Classes:
XmlPreferenceStorage

public interface PreferenceStorage

The PreferenceStorage stores key - value pairs into a persistent storage

Since:
4.0
Author:
Thomas Kissinger

Method Summary
 void close()
          Close storage access
 boolean getWriteBack()
          returns the writeback property
 int loadInt(java.lang.String key)
          Loads the value for the corresponding key as int
 java.lang.String loadString(java.lang.String key)
          Loads the value for the corresponding key as String
 boolean remove(java.lang.String key)
          Removes the specified key from storage
 boolean save(java.lang.String key, int value)
          Save the key - value pair to storage
 boolean save(java.lang.String key, java.lang.String value)
          Save the key - value pair to storage
 void setWriteBack(boolean writeback)
          Set writeback to true, if the changes should be written immediately back to the storage, otherwise changes are saved on close or earlier
 

Method Detail

save

boolean save(java.lang.String key,
             java.lang.String value)
Save the key - value pair to storage

Parameters:
key -
value -
Returns:
true, if successful. otherwise false

save

boolean save(java.lang.String key,
             int value)
Save the key - value pair to storage

Parameters:
key -
value -
Returns:
true, if successful. otherwise false

loadString

java.lang.String loadString(java.lang.String key)
Loads the value for the corresponding key as String

Parameters:
key -
Returns:
the value

remove

boolean remove(java.lang.String key)
Removes the specified key from storage

Parameters:
key - to remove
Returns:
true, if key was found an removed

loadInt

int loadInt(java.lang.String key)
Loads the value for the corresponding key as int

Parameters:
key -
Returns:
the value

setWriteBack

void setWriteBack(boolean writeback)
Set writeback to true, if the changes should be written immediately back to the storage, otherwise changes are saved on close or earlier

Parameters:
writeback -

getWriteBack

boolean getWriteBack()
returns the writeback property

Returns:
true, if writeback is enabled

close

void close()
Close storage access