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
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 TypeMethodDescriptionvoidImplementors should take care to ensure that this can be called after initial construction without unexpected interactions between construction parameters and configuration parameters.static voidapplyMatching(NBConfiguration cfg, Object... configurables) Convenience method to apply a configuration to any object which is expected to be be configurable.static NBConfigModelcollectModels(Class<?> of, Object... configurables) static NBConfigModelcollectModels(Class<?> of, Collection<?> configurables) 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
-
applyMatching
Convenience method to apply a configuration to any object which is expected to be be configurable.- Parameters:
cfg- The cfg to applyconfigurables- zero or more Objects which may implement NBConfigurable
-
collectModels
-
collectModels
-