public interface PreferenceStore
Modifier and Type | Method and Description |
---|---|
Map<String,Object> |
all()
Retrieves all defined preferences.
|
Map<String,Object> |
all(PreferenceScope scope)
Retrieves all defined preferences from a specific scope.
|
Map<String,Object> |
all(PreferenceScopeResolutionStrategyInfo scopeResolutionStrategyInfo)
Retrieves all defined preferences.
|
Map<String,PreferenceScopedValue<Object>> |
allScoped()
Retrieves all defined preferences.
|
Map<String,PreferenceScopedValue<Object>> |
allScoped(PreferenceScopeResolutionStrategyInfo scopeResolutionStrategyInfo)
Retrieves all defined preferences.
|
<T> T |
get(PreferenceScopeResolutionStrategyInfo scopeResolutionStrategyInfo,
String key)
Retrieves a preference value from the first scope of the scopeResolutionStrategy order that
has the preference defined.
|
<T> T |
get(PreferenceScopeResolutionStrategyInfo scopeResolutionStrategyInfo,
String key,
T defaultValue)
Retrieves a preference value from the first scope of the scopeResolutionStrategy order that
has the preference defined.
|
<T> T |
get(PreferenceScope scope,
String key)
Retrieves a preference value from a specific scope.
|
<T> T |
get(PreferenceScope scope,
String key,
T defaultValue)
Retrieves a preference value from a specific scope.
|
<T> T |
get(String key)
Retrieves a preference value from the first scope of the default scope resolution strategy order that
has the preference defined.
|
<T> T |
get(String key,
T defaultValue)
Retrieves a preference value from the first scope of the default scope resolution strategy order that
has the preference defined.
|
PreferenceScopeResolutionStrategyInfo |
getDefaultScopeResolutionStrategyInfo()
Provides a portable instance that has the scope resolution strategy order and the default scope
for preference persistence.
|
PreferenceScopeResolver |
getDefaultScopeResolver()
Provides a portable instance that resolves scopes in the default scope resolution strategy order.
|
<T> PreferenceScopedValue<T> |
getScoped(PreferenceScopeResolutionStrategyInfo scopeResolutionStrategyInfo,
String key)
Retrieves a scoped preference value from the first scope of the scopeResolutionStrategy order that
has the preference defined.
|
<T> PreferenceScopedValue<T> |
getScoped(PreferenceScopeResolutionStrategyInfo scopeResolutionStrategyInfo,
String key,
T defaultValue)
Retrieves a scoped preference value from the first scope of the scopeResolutionStrategy order that
has the preference defined.
|
<T> PreferenceScopedValue<T> |
getScoped(String key)
Retrieves a preference value from the first scope of the default scope resolution strategy order that
has the preference defined.
|
<T> PreferenceScopedValue<T> |
getScoped(String key,
T defaultValue)
Retrieves a preference value from the first scope of the default scope resolution strategy order that
has the preference defined.
|
<T> void |
put(Map<String,T> valueByKey)
Stores several preferences inside the default scope (see
defaultScope . |
<T> void |
put(PreferenceScope scope,
Map<String,T> valueByKey)
Stores several preferences inside a specific scope.
|
<T> void |
put(PreferenceScopeResolutionStrategyInfo scopeResolutionStrategyInfo,
Map<String,T> valueByKey)
Stores several preferences inside the default scope (see
defaultScope . |
<T> void |
put(PreferenceScopeResolutionStrategyInfo scopeResolutionStrategyInfo,
String key,
T value)
Stores a preference inside the default scope (see
defaultScope . |
<T> void |
put(PreferenceScope scope,
String key,
T value)
Stores a preference inside a specific scope.
|
<T> void |
put(String key,
T value)
Stores a preference inside the default scope (see
defaultScope . |
<T> void |
putIfAbsent(Map<String,T> valueByKey)
Stores several preferences inside the default scope (see
defaultScope . |
<T> void |
putIfAbsent(PreferenceScope scope,
Map<String,T> valueByKey)
Stores several preferences inside a specific scope, if they are not already defined in that scope.
|
<T> void |
putIfAbsent(PreferenceScopeResolutionStrategyInfo scopeResolutionStrategyInfo,
Map<String,T> valueByKey)
Stores several preferences inside the default scope (see
defaultScope ,
if they are not already defined in that scope. |
<T> void |
putIfAbsent(PreferenceScopeResolutionStrategyInfo scopeResolutionStrategyInfo,
String key,
T value)
Stores a preference inside the default scope (see
defaultScope ,
if it is not already defined in that scope. |
<T> void |
putIfAbsent(PreferenceScope scope,
String key,
T value)
Stores a preference inside a specific scope, if it is not already defined in that scope.
|
<T> void |
putIfAbsent(String key,
T value)
Stores a preference inside the default scope (see
defaultScope ,
if it is not already defined in that scope. |
void |
remove(List<PreferenceScope> scopes,
String key)
Removes a preference from a list of scopes.
|
void |
remove(PreferenceScope scope,
String key)
Removes a preference from a specific scope.
|
Map<String,Object> |
search(Collection<String> keys)
Retrieves several preferences, which keys were passed.
|
Map<String,Object> |
search(PreferenceScope scope,
Collection<String> keys)
Retrieves several preferences, which keys were passed, from a specific scope.
|
Map<String,Object> |
search(PreferenceScopeResolutionStrategyInfo scopeResolutionStrategyInfo,
Collection<String> keys)
Retrieves several preferences, which keys were passed.
|
Map<String,PreferenceScopedValue<Object>> |
searchScoped(Collection<String> keys)
Retrieves several scoped preferences, which keys were passed.
|
Map<String,PreferenceScopedValue<Object>> |
searchScoped(PreferenceScopeResolutionStrategyInfo scopeResolutionStrategyInfo,
Collection<String> keys)
Retrieves several scoped preferences, which keys were passed.
|
PreferenceScopeResolutionStrategyInfo getDefaultScopeResolutionStrategyInfo()
PreferenceScopeResolver getDefaultScopeResolver()
<T> void put(PreferenceScope scope, String key, T value)
T
- Type of the preference value.scope
- Scope in which the preference will be stored. Must not be null.key
- The key of the preference, must not be null.value
- The value of the preference, could be null.<T> void put(PreferenceScopeResolutionStrategyInfo scopeResolutionStrategyInfo, String key, T value)
defaultScope
.T
- Type of the preference value.scopeResolutionStrategyInfo
- Scope resolution strategy that defines the default scope, in which the
preference will be stored. Must not be null.key
- The key of the preference, must not be null.value
- The value of the preference, could be null.<T> void put(String key, T value)
defaultScope
.T
- Type of the preference value.key
- The key of the preference, must not be null.value
- The value of the preference, could be null.<T> void put(PreferenceScope scope, Map<String,T> valueByKey)
T
- Type of the preference values.scope
- Scope in which the preference will be stored. Must not be null.valueByKey
- Map that contains a preference value (can be null) for each preference key (must not be null).<T> void put(PreferenceScopeResolutionStrategyInfo scopeResolutionStrategyInfo, Map<String,T> valueByKey)
defaultScope
.T
- Type of the preference values.scopeResolutionStrategyInfo
- Scope resolution strategy that defines the default scope. Must not be null.valueByKey
- Map that contains a preference value (can be null) for each preference key (must not be null).<T> void put(Map<String,T> valueByKey)
defaultScope
.T
- Type of the preference values.valueByKey
- Map that contains a preference value (can be null) for each preference key (must not be null).<T> void putIfAbsent(PreferenceScope scope, String key, T value)
T
- Type of the preference value.scope
- Scope in which the preference will be stored. Must not be null.key
- The key of the preference, must not be null.value
- The value of the preference, could be null.<T> void putIfAbsent(PreferenceScopeResolutionStrategyInfo scopeResolutionStrategyInfo, String key, T value)
defaultScope
,
if it is not already defined in that scope.T
- Type of the preference value.scopeResolutionStrategyInfo
- Scope resolution strategy that defines the default scope.
in which the preference will be stored. Must not be null.key
- The key of the preference, must not be null.value
- The value of the preference, could be null.<T> void putIfAbsent(String key, T value)
defaultScope
,
if it is not already defined in that scope.T
- Type of the preference value.key
- The key of the preference, must not be null.value
- The value of the preference, could be null.<T> void putIfAbsent(PreferenceScope scope, Map<String,T> valueByKey)
T
- Type of the preference values.scope
- Scope in which the preference will be stored. Must not be null.valueByKey
- Map that contains a preference value (can be null) for each preference key (must not be null).<T> void putIfAbsent(PreferenceScopeResolutionStrategyInfo scopeResolutionStrategyInfo, Map<String,T> valueByKey)
defaultScope
,
if they are not already defined in that scope.T
- Type of the preference values.scopeResolutionStrategyInfo
- Scope resolution strategy that defines the default scope. Must not be null.valueByKey
- Map that contains a preference value (can be null) for each preference key (must not be null).<T> void putIfAbsent(Map<String,T> valueByKey)
defaultScope
.T
- Type of the preference values.valueByKey
- Map that contains a preference value (can be null) for each preference key (must not be null).<T> T get(PreferenceScope scope, String key)
T
- Type of the preference value.scope
- Scope in which the preference value will be searched. Must not be null.key
- Preference key to be searched, must not be null.<T> T get(PreferenceScope scope, String key, T defaultValue)
T
- Type of the preference value.scope
- Scope in which the preference value will be searched. Must not be null.key
- Preference key to be searched, must not be null.defaultValue
- Value to be returned if the preference is not defined in that scope.<T> T get(PreferenceScopeResolutionStrategyInfo scopeResolutionStrategyInfo, String key)
T
- Type of the preference value.scopeResolutionStrategyInfo
- Scope resolution strategy that defines the order on which the
scopes will be searched. Must not be null.key
- Preference key to be searched, must not be null.<T> T get(PreferenceScopeResolutionStrategyInfo scopeResolutionStrategyInfo, String key, T defaultValue)
T
- Type of the preference value.scopeResolutionStrategyInfo
- Scope resolution strategy that defines the order on which the
scopes will be searched. Must not be null.key
- Preference key to be searched, must not be null.defaultValue
- Value to be returned if the preference is not defined in any scope.<T> T get(String key)
T
- Type of the preference value.key
- Preference key to be searched, must not be null.<T> T get(String key, T defaultValue)
T
- Type of the preference value.key
- Preference key to be searched, must not be null.defaultValue
- Value to be returned if the preference is not defined in any scope.<T> PreferenceScopedValue<T> getScoped(PreferenceScopeResolutionStrategyInfo scopeResolutionStrategyInfo, String key)
T
- Type of the preference value.scopeResolutionStrategyInfo
- Scope resolution strategy that defines the order on which the
scopes will be searched. Must not be null.key
- Preference key to be searched, must not be null.<T> PreferenceScopedValue<T> getScoped(PreferenceScopeResolutionStrategyInfo scopeResolutionStrategyInfo, String key, T defaultValue)
T
- Type of the preference value.scopeResolutionStrategyInfo
- Scope resolution strategy that defines the order on which the
scopes will be searched. Must not be null.key
- Preference key to be searched, must not be null.defaultValue
- Value to be returned if the preference is not defined in any scope.<T> PreferenceScopedValue<T> getScoped(String key)
T
- Type of the preference value.key
- Preference key to be searched, must not be null.<T> PreferenceScopedValue<T> getScoped(String key, T defaultValue)
T
- Type of the preference value.key
- Preference key to be searched, must not be null.defaultValue
- Value to be returned if the preference is not defined in any scope.Map<String,Object> search(PreferenceScope scope, Collection<String> keys)
scope
- Scope in which the preferences values will be searched. Must not be null.keys
- Preference keys to search. If null, all keys in that scope will be searched.Map<String,Object> search(PreferenceScopeResolutionStrategyInfo scopeResolutionStrategyInfo, Collection<String> keys)
scopeResolutionStrategyInfo
- Scope resolution strategy that defines the order on which the
scopes will be searched. Must not be null.keys
- Preference keys to search. If null, all keys in that scope resolution strategy will be searched.Map<String,Object> search(Collection<String> keys)
keys
- Preference keys to search. If null, all keys in the default scope resolution strategy type will be
searched.Map<String,PreferenceScopedValue<Object>> searchScoped(PreferenceScopeResolutionStrategyInfo scopeResolutionStrategyInfo, Collection<String> keys)
scopeResolutionStrategyInfo
- Scope resolution strategy that defines the order on which the
scopes will be searched. Must not be null.keys
- Preference keys to search. If null, all keys in that scope resolution strategy will be searched.Map<String,PreferenceScopedValue<Object>> searchScoped(Collection<String> keys)
keys
- Preference keys to search. If null, all keys in the default scope resolution strategy will be searched.Map<String,Object> all(PreferenceScope scope)
scope
- Scope in which the preferences values will be searched. Must not be null.Map<String,Object> all(PreferenceScopeResolutionStrategyInfo scopeResolutionStrategyInfo)
scopeResolutionStrategyInfo
- Scope resolution strategy that defines the order on which the
scopes will be searched. Must not be null.Map<String,Object> all()
Map<String,PreferenceScopedValue<Object>> allScoped(PreferenceScopeResolutionStrategyInfo scopeResolutionStrategyInfo)
scopeResolutionStrategyInfo
- Scope resolution strategy that defines the order on which the
scopes will be searched. Must not be null.Map<String,PreferenceScopedValue<Object>> allScoped()
void remove(PreferenceScope scope, String key)
scope
- Scope in which the preference will be removed. Must not be null.key
- Key of the preference that should be removed. Must not be null.void remove(List<PreferenceScope> scopes, String key)
scopes
- Scopes from which the preference will be removed. Must not be null.key
- Key of the preference that will be removed. Must not be null.Copyright © 2012–2018 JBoss by Red Hat. All rights reserved.