Class OsgiPreferenceMetadataStore
- java.lang.Object
-
- org.eclipse.core.runtime.preferences.OsgiPreferenceMetadataStore
-
- All Implemented Interfaces:
IPreferenceMetadataStore
public final class OsgiPreferenceMetadataStore extends Object implements IPreferenceMetadataStore
The preference store implementation that uses OSGi preference node as an enclosed storage.- Since:
- 3.8
- See Also:
IEclipsePreferences
-
-
Constructor Summary
Constructors Constructor Description OsgiPreferenceMetadataStore(IEclipsePreferences preferences)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description <V> booleanhandles(Class<V> valueType)Checks if this value type can be handled by this preference store.<V> Vload(PreferenceMetadata<V> preference)Loads the value of specified preference from an enclosed storage.<V> voidsave(V value, PreferenceMetadata<V> preference)Saves the value of specified preference to the enclosed storage.
-
-
-
Constructor Detail
-
OsgiPreferenceMetadataStore
public OsgiPreferenceMetadataStore(IEclipsePreferences preferences)
- Parameters:
preferences- the OSGi preference node, must not benull
-
-
Method Detail
-
handles
public <V> boolean handles(Class<V> valueType)
Description copied from interface:IPreferenceMetadataStoreChecks if this value type can be handled by this preference store.- Specified by:
handlesin interfaceIPreferenceMetadataStore- 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
public <V> V load(PreferenceMetadata<V> preference)
Description copied from interface:IPreferenceMetadataStoreLoads the value of specified preference from an enclosed storage. If the value is not found returns the preference default value.- Specified by:
loadin interfaceIPreferenceMetadataStore- 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
- See Also:
IPreferenceMetadataStore.handles(Class),PreferenceMetadata
-
save
public <V> void save(V value, PreferenceMetadata<V> preference)Description copied from interface:IPreferenceMetadataStoreSaves the value of specified preference to the enclosed storage.- Specified by:
savein interfaceIPreferenceMetadataStore- Type Parameters:
V- the value type for the preference- Parameters:
value- to be saved, must not benull.preference- the preference metadata, must not benull.- See Also:
IPreferenceMetadataStore.handles(Class),PreferenceMetadata
-
-