Interface NBConfigurable

All Superinterfaces:
NBCanConfigure, NBConfigModelProvider
All Known Subinterfaces:
DiagTask
All Known Implementing Classes:
AmqpDriverAdapter, AzureAISearchDriverAdapter, BaseDiagTask, BaseDriverAdapter, CGNameObfuscator, CGRatioSuffixer, Cqld4DriverAdapter, CqlDriverAdapterStub, DataApiDriverAdapter, DiagDriverAdapter, DiagTask_diagrate, DiagTask_erroroncycle, DiagTask_gauge, DiagTask_initdelay, DiagTask_log, DiagTask_noop, DynamoDBDriverAdapter, ExampleDriverAdapter, GCPSpannerDriverAdapter, GrafanaMetricsAnnotator, HttpDriverAdapter, KafkaDriverAdapter, MongodbDriverAdapter, Neo4JDriverAdapter, OptionHelpers, PulsarDriverAdapter, QdrantDriverAdapter, S4JDriverAdapter, StdoutDriverAdapter, TcpClientDriverAdapter, TcpServerDriverAdapter, WeaviateDriverAdapter

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 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
    • applyMatching

      static void applyMatching(NBConfiguration cfg, Object... configurables)
      Convenience method to apply a configuration to any object which is expected to be be configurable.
      Parameters:
      cfg - The cfg to apply
      configurables - zero or more Objects which may implement NBConfigurable
    • collectModels

      static NBConfigModel collectModels(Class<?> of, Collection<?> configurables)
    • collectModels

      static NBConfigModel collectModels(Class<?> of, Object... configurables)