public interface PreferenceStorage
Modifier and Type | Method and Description |
---|---|
Collection<String> |
allKeys(List<PreferenceScope> scopes)
Returns all preference keys defined in all passed scopes.
|
Collection<String> |
allKeys(PreferenceScope scope)
Returns all preference keys defined in a specific scope.
|
void |
delete(PreferenceScope scope,
String key)
Deletes a preference, in a specific scope, if it exists.
|
boolean |
exists(PreferenceScopeResolutionStrategyInfo scopeResolutionStrategyInfo,
String key)
Checks if a given preference key is defined in any scope of the provided hierarchy.
|
boolean |
exists(PreferenceScope preferenceScope,
String key)
Checks if a given preference key is defined in a certain scope.
|
<T> T |
read(PreferenceScopeResolutionStrategyInfo scopeResolutionStrategyInfo,
String key)
Tries to read a preference value from a scope hierarchy.
|
<T> T |
read(PreferenceScope preferenceScope,
String key)
Tries to read a preference value from a specific scope.
|
<T> PreferenceScopedValue<T> |
readWithScope(PreferenceScopeResolutionStrategyInfo scopeResolutionStrategyInfo,
String key)
Tries to read a preference value from a scope hierarchy.
|
void |
write(PreferenceScope scope,
String key,
Object value)
(Over) Writes a preference value related to a preference key, for a specific scope.
|
boolean exists(PreferenceScope preferenceScope, String key)
preferenceScope
- Scope in which the key will be checked.key
- Key to be checked (must not be null).boolean exists(PreferenceScopeResolutionStrategyInfo scopeResolutionStrategyInfo, String key)
scopeResolutionStrategyInfo
- Hierarchy of scopes in which the key will be checked.key
- Key to be checked (must not be null).<T> T read(PreferenceScope preferenceScope, String key)
T
- Type of the preference value.preferenceScope
- Scope in which the key will be searched.key
- Preference key to be read (must not be null).<T> T read(PreferenceScopeResolutionStrategyInfo scopeResolutionStrategyInfo, String key)
T
- Type of the preference value.scopeResolutionStrategyInfo
- Scope hierarchy in which the key will be searched.key
- Preference key to be read (must not be null).<T> PreferenceScopedValue<T> readWithScope(PreferenceScopeResolutionStrategyInfo scopeResolutionStrategyInfo, String key)
T
- Type of the preference value.scopeResolutionStrategyInfo
- Scope hierarchy in which the key will be searched.key
- Preference key to be read (must not be null).void write(PreferenceScope scope, String key, Object value)
scope
- Scope in which the preference will be written.key
- The key of the preference, must not be null.value
- The value of the preference, could be null.void delete(PreferenceScope scope, String key)
scope
- Scope in which the preference is stored.key
- The key of the preference to be deleted, must not be null.Collection<String> allKeys(PreferenceScope scope)
scope
- Scope in which the preference keys will be searched.Collection<String> allKeys(List<PreferenceScope> scopes)
scopes
- Scopes in which the preference keys will be searched.Copyright © 2012–2020 JBoss by Red Hat. All rights reserved.