Class PreferenceScopeFactoryImpl
- java.lang.Object
-
- org.uberfire.preferences.shared.impl.PreferenceScopeFactoryImpl
-
- All Implemented Interfaces:
PreferenceScopeFactory
@ApplicationScoped public class PreferenceScopeFactoryImpl extends Object implements PreferenceScopeFactory
-
-
Constructor Summary
Constructors Modifier Constructor Description protectedPreferenceScopeFactoryImpl()PreferenceScopeFactoryImpl(PreferenceScopeTypes scopeTypes)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description PreferenceScopecloneScope(PreferenceScope scope)Clones the passed scope to a new instance.PreferenceScopecreateScope(String type)Builds a new preference scope, that does not require a custom key.PreferenceScopecreateScope(String type, String key)Builds a new preference scope, that requires a custom key.PreferenceScopecreateScope(String type, String key, PreferenceScope childScope)Builds a new preference scope, that requires a custom key, and has the passed child scope.PreferenceScopecreateScope(String type, PreferenceScope childScope)Builds a new preference scope, that does not require a custom key, and has the passed child scope.PreferenceScopecreateScope(PreferenceScope... scopes)Builds a new preference scope, that contains the following ones as child scopes.
-
-
-
Constructor Detail
-
PreferenceScopeFactoryImpl
protected PreferenceScopeFactoryImpl()
-
PreferenceScopeFactoryImpl
@Inject public PreferenceScopeFactoryImpl(PreferenceScopeTypes scopeTypes)
-
-
Method Detail
-
createScope
public PreferenceScope createScope(String type) throws InvalidPreferenceScopeException
Description copied from interface:PreferenceScopeFactoryBuilds a new preference scope, that does not require a custom key.- Specified by:
createScopein interfacePreferenceScopeFactory- Parameters:
type- Type of the new preference scope.- Returns:
- A new preference scope.
- Throws:
InvalidPreferenceScopeException- if the type passed is invalid, or if it requires a key.
-
createScope
public PreferenceScope createScope(String type, PreferenceScope childScope) throws InvalidPreferenceScopeException
Description copied from interface:PreferenceScopeFactoryBuilds a new preference scope, that does not require a custom key, and has the passed child scope.- Specified by:
createScopein interfacePreferenceScopeFactory- Parameters:
type- Type of the new preference scope.- Returns:
- A new preference scope.
- Throws:
InvalidPreferenceScopeException- if the type passed is invalid, or if it requires a key.
-
createScope
public PreferenceScope createScope(String type, String key) throws InvalidPreferenceScopeException
Description copied from interface:PreferenceScopeFactoryBuilds a new preference scope, that requires a custom key.- Specified by:
createScopein interfacePreferenceScopeFactory- Parameters:
type- Type of the new preference scope.key- Key of the new preference scope.- Returns:
- A new preference scope.
- Throws:
InvalidPreferenceScopeException- if the type passed is invalid, or if it does not require a key.
-
createScope
public PreferenceScope createScope(String type, String key, PreferenceScope childScope) throws InvalidPreferenceScopeException
Description copied from interface:PreferenceScopeFactoryBuilds a new preference scope, that requires a custom key, and has the passed child scope.- Specified by:
createScopein interfacePreferenceScopeFactory- Parameters:
type- Type of the new preference scope.key- Key of the new preference scope.childScope- Child scope of this scope. It can be null if the scope has no child.- Returns:
- A new preference scope.
- Throws:
InvalidPreferenceScopeException- if the type passed is invalid, or if it does not require a key.
-
createScope
public PreferenceScope createScope(PreferenceScope... scopes) throws InvalidPreferenceScopeException
Description copied from interface:PreferenceScopeFactoryBuilds a new preference scope, that contains the following ones as child scopes.- Specified by:
createScopein interfacePreferenceScopeFactory- Parameters:
scopes- The first scope is the root scope, the second is its child scope, and so on.- Returns:
- A new preference scope.
- Throws:
InvalidPreferenceScopeException- if any passed scope is invalid.
-
cloneScope
public PreferenceScope cloneScope(PreferenceScope scope)
Description copied from interface:PreferenceScopeFactoryClones the passed scope to a new instance.- Specified by:
cloneScopein interfacePreferenceScopeFactory- Parameters:
scope- Scope to be cloned. Must not be null.- Returns:
- New scope instance equal to the passed one.
-
-