public final class SettingRegistryAdapter
Adapter that bridges the new ISettingRegistry framework with the legacy BundleSettingStore persistence layer.
Use this class instead of calling ISettingRegistry directly when
the caller also needs a graceful fallback to the legacy properties file if
the registry is unavailable or throws. This is the typical case for setting
stores that existed before the new registry was introduced.
All methods are static and stateless; pass the registry, the definition, the value (for writes), and the legacy store that serves as the fallback.
| Type Params | Return Type | Name and description |
|---|---|---|
<T> |
public static void |
clearSettingWithLegacyFallback(ISettingRegistry registry, SettingDefinition<T> definition, BundleSettingStore legacyStore)Clears a setting value using the new registry, falling back to the legacy store if the registry is null or throws. |
<T> |
public static void |
clearSettingWithLegacyFallback(ISettingRegistry registry, SettingDefinition<T> definition, String filePath)Clears a setting value using the new registry, falling back to a file-based legacy store if the registry is null or throws. |
<T> |
public static T |
readSettingWithLegacyFallback(ISettingRegistry registry, SettingDefinition<T> definition, BundleSettingStore legacyStore)Reads a setting value using the new registry, falling back to the legacy store if the registry is null or throws. |
<T> |
public static T |
readSettingWithLegacyFallback(ISettingRegistry registry, SettingDefinition<T> definition, String filePath) |
<T> |
public static T |
safelyReadSettingWithLegacyFallback(ISettingRegistry registry, SettingDefinition<T> definition, BundleSettingStore legacyStore) |
<T> |
public static void |
writeSettingWithLegacyFallback(ISettingRegistry registry, SettingDefinition<T> definition, T value, BundleSettingStore legacyStore)Writes a setting value using the new registry, falling back to the legacy store if the registry is null or throws. |
<T> |
public static void |
writeSettingWithLegacyFallback(ISettingRegistry registry, SettingDefinition<T> definition, T value, String filePath) |
Clears a setting value using the new registry, falling back to the legacy
store if the registry is null or throws.
T - the setting value typeregistry - the new setting registry (may be null)definition - the setting definitionlegacyStore - the legacy bundle setting store used as fallback Clears a setting value using the new registry, falling back to a file-based
legacy store if the registry is null or throws.
T - the setting value typeregistry - the new setting registry (may be null)definition - the setting definitionfilePath - the path to the legacy properties file used as fallback Reads a setting value using the new registry, falling back to the legacy
store if the registry is null or throws.
T - the setting value typeregistry - the new setting registry (may be null)definition - the setting definitionlegacyStore - the legacy bundle setting store used as fallback Writes a setting value using the new registry, falling back to the legacy
store if the registry is null or throws.
T - the setting value typeregistry - the new setting registry (may be null)definition - the setting definitionvalue - the value to writelegacyStore - the legacy bundle setting store used as fallback