public final class OsgiPreferenceStorage extends Object implements OptionStorage
Preferences
Constructor and Description |
---|
OsgiPreferenceStorage(org.osgi.service.prefs.Preferences preferences) |
Modifier and Type | Method and Description |
---|---|
<V> boolean |
consumable(Class<V> valueType)
Checks if the value type can be consumed by an enclosed storage.
|
<V> V |
load(OptionMetadata<V> option)
Loads the value of specified option from an enclosed storage.
|
<V> void |
save(V value,
OptionMetadata<V> option)
Saves the value of specified option to the enclosed storage.
|
public OsgiPreferenceStorage(org.osgi.service.prefs.Preferences preferences)
preferences
- the OSGi preference node, must not be null
public <V> boolean consumable(Class<V> valueType)
OptionStorage
consumable
in interface OptionStorage
V
- the value type for the optionvalueType
- the value type to be checkedpublic <V> V load(OptionMetadata<V> option)
OptionStorage
load
in interface OptionStorage
V
- the value type for the optionoption
- the option metadata, must not be null
.OptionStorage.consumable(Class)
,
OptionMetadata
public <V> void save(V value, OptionMetadata<V> option)
OptionStorage
save
in interface OptionStorage
V
- the value type for the optionvalue
- to be saved, must not be null
.option
- the option metadata, must not be null
.OptionStorage.consumable(Class)
,
OptionMetadata
Copyright (c) IBM Corp. and others 2004, 2020. All Rights Reserved.