Class PropertyScope
java.lang.Object
org.openwms.core.preferences.PropertyScope
- All Implemented Interfaces:
Serializable
A PropertyScope defines the different scopes for preferences. The built-in scopes APPLICATION, MODULE, ROLE, and USER are generic
and always available. Downstream consumers can register additional domain-specific scopes (e.g. WAREHOUSE, TENANT) via the
PropertyScopes registry without modifying this library. This enables a generic mechanism for scope extensibility while
maintaining type safety and validation: registered scope names follow the pattern [A-Z][A-Z0-9_]*.- Author:
- Heiko Scherrer
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final PropertyScopeThis kind of preference belongs to the main application.static final PropertyScopeThis kind of preference is specific to aModule.private final Stringstatic final PropertyScopeThis kind of preference belongs to a particularRole.static final PropertyScopeThis kind of preference belongs to a certainUser. -
Constructor Summary
Constructors -
Method Summary
-
Field Details
-
APPLICATION
This kind of preference belongs to the main application. -
MODULE
This kind of preference is specific to aModule. -
ROLE
This kind of preference belongs to a particularRole. -
USER
This kind of preference belongs to a certainUser. -
name
-
-
Constructor Details
-
PropertyScope
PropertyScope(String name) Creates a PropertyScope with the given name. The name must match the pattern [A-Z][A-Z0-9_]*.- Parameters:
name- the scope name, must not be blank and must match the validation pattern- Throws:
IllegalArgumentException- if the name is invalid
-
-
Method Details
-
of
Factory method to create or retrieve a PropertyScope. For the built-in scopes APPLICATION, MODULE, ROLE, and USER, returns the static constants. For custom scopes registered viaPropertyScopes, returns a new instance if the name matches the validation pattern.- Parameters:
name- the scope name, must match [A-Z][A-Z0-9_]*- Returns:
- a PropertyScope instance
- Throws:
IllegalArgumentException- if the name is invalid
-
name
-
equals
-
hashCode
-
toString
-