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
    void applyConfig​(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.
    NBConfigModel getConfigModel()
    Implement this method by returning an instance of ConfigModel.
  • Method Details

    • applyConfig

      void applyConfig​(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.
      Specified by:
      applyConfig in interface NBCanConfigure
      Parameters:
      cfg - The configuration data to be applied to a new instance
    • getConfigModel

      NBConfigModel getConfigModel()
      Implement this method by returning an instance of ConfigModel. Any configuration which is provided to the applyConfig(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:
      getConfigModel in interface NBConfigModelProvider
      Returns:
      A valid configuration model for the implementing class