Interface IPreferenceMetadataStore
- All Known Implementing Classes:
OsgiPreferenceMetadataStore
public interface IPreferenceMetadataStore
Provides metadata-based access to a preference store.
- Since:
- 3.8
-
Method Summary
Modifier and TypeMethodDescription<V> boolean
Checks if this value type can be handled by this preference store.<V> V
load
(PreferenceMetadata<V> preference) Loads the value of specified preference from an enclosed storage.<V> void
save
(V value, PreferenceMetadata<V> preference) Saves the value of specified preference to the enclosed storage.
-
Method Details
-
handles
Checks if this value type can be handled by this preference store.- Type Parameters:
V
- the value type for the preference- Parameters:
valueType
- the value type to be checked- Returns:
- true if this value type can be handled by this preference store and false otherwise
-
load
Loads the value of specified preference from an enclosed storage. If the value is not found returns the preference default value.- Type Parameters:
V
- the value type for the preference- Parameters:
preference
- the preference metadata, must not benull
.- Returns:
- the preference value or default value if preference is unknown
- Throws:
UnsupportedOperationException
- for unsupported preference value types- See Also:
-
save
Saves the value of specified preference to the enclosed storage.- Type Parameters:
V
- the value type for the preference- Parameters:
value
- to be saved, must not benull
.preference
- the preference metadata, must not benull
.- Throws:
UnsupportedOperationException
- for unsupported preference value types- See Also:
-