Module dev.metaschema.core
Class DefaultConfiguration<T extends IConfigurationFeature<?>>
java.lang.Object
dev.metaschema.core.configuration.DefaultConfiguration<T>
- Type Parameters:
T- the type of managed features
- All Implemented Interfaces:
IConfiguration<T>,IMutableConfiguration<T>
public class DefaultConfiguration<T extends IConfigurationFeature<?>>
extends Object
implements IMutableConfiguration<T>
Provides a basic configuration management implementation that allows mutable
access to configuration state.
-
Constructor Summary
ConstructorsConstructorDescriptionCreate a new configuration.DefaultConfiguration(DefaultConfiguration<T> original) Create a new configuration based on the provided configuration.DefaultConfiguration(Map<T, Object> featureValues) Create a new configuration based on the provided feature value map. -
Method Summary
Modifier and TypeMethodDescriptionapplyConfiguration(IConfiguration<T> original) Replace this configuration with theotherconfiguration.disableFeature(T feature) Turn off the provided feature.enableFeature(T feature) Turn on the provided feature.Get the mapping of each feature mapped to its value.booleanisFeatureEnabled(T feature) Determines if a specific feature is enabled.Set the value of the providedfeatureto the provided value.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface dev.metaschema.core.configuration.IConfiguration
get
-
Constructor Details
-
DefaultConfiguration
public DefaultConfiguration()Create a new configuration. -
DefaultConfiguration
Create a new configuration based on the provided feature value map.- Parameters:
featureValues- the set of enabled features
-
DefaultConfiguration
Create a new configuration based on the provided configuration.- Parameters:
original- the original configuration
-
-
Method Details
-
getFeatureValues
Description copied from interface:IConfigurationGet the mapping of each feature mapped to its value.- Specified by:
getFeatureValuesin interfaceIConfiguration<T extends IConfigurationFeature<?>>- Returns:
- the mapping
-
isFeatureEnabled
Description copied from interface:IConfigurationDetermines if a specific feature is enabled.- Specified by:
isFeatureEnabledin interfaceIConfiguration<T extends IConfigurationFeature<?>>- Parameters:
feature- the feature to check for- Returns:
trueif the feature is enabled, orfalseotherwise- See Also:
-
enableFeature
Description copied from interface:IMutableConfigurationTurn on the provided feature.- Specified by:
enableFeaturein interfaceIMutableConfiguration<T extends IConfigurationFeature<?>>- Parameters:
feature- the feature to turn on- Returns:
- the updated configuration
- See Also:
-
disableFeature
Description copied from interface:IMutableConfigurationTurn off the provided feature.- Specified by:
disableFeaturein interfaceIMutableConfiguration<T extends IConfigurationFeature<?>>- Parameters:
feature- the feature to turn off- Returns:
- the updated configuration
- See Also:
-
applyConfiguration
Description copied from interface:IMutableConfigurationReplace this configuration with theotherconfiguration.- Specified by:
applyConfigurationin interfaceIMutableConfiguration<T extends IConfigurationFeature<?>>- Parameters:
original- the new configuration- Returns:
- the updated configuration
-
set
Description copied from interface:IMutableConfigurationSet the value of the providedfeatureto the provided value.- Specified by:
setin interfaceIMutableConfiguration<T extends IConfigurationFeature<?>>- Parameters:
feature- the feature to setvalue- the value to set- Returns:
- the updated configuration
- See Also:
-