Interface NBConfigurable
- All Superinterfaces:
NBCanConfigure,NBConfigModelProvider
public interface NBConfigurable extends NBCanConfigure, NBConfigModelProvider
All implementation types which wish to have a type-marshalled configuration
should implement this interface.
When a type which implements this interface is instantiated, and the
NBConfiguration was not injected into its constructor,
the builder should call applyConfig(NBConfiguration) immediately
after calling the constructor.-
Method Summary
Modifier and Type Method Description voidapplyConfig(NBConfiguration cfg)Implementors should take care to ensure that this can be called after initial construction without unexpected interactions between construction parameters and configuration parameters.NBConfigModelgetConfigModel()Implement this method by returning an instance ofConfigModel.
-
Method Details
-
applyConfig
Implementors should take care to ensure that this can be called after initial construction without unexpected interactions between construction parameters and configuration parameters.- Specified by:
applyConfigin interfaceNBCanConfigure- Parameters:
cfg- The configuration data to be applied to a new instance
-
getConfigModel
NBConfigModel getConfigModel()Implement this method by returning an instance ofConfigModel. Any configuration which is provided to theapplyConfig(NBConfiguration)method will be validated through this model. A configuration model is required in order to build a validated configuration from source data provided by a user.- Specified by:
getConfigModelin interfaceNBConfigModelProvider- Returns:
- A valid configuration model for the implementing class
-