facet classafIocConfig::Config
sys::Obj afIocConfig::Config : sys::Facet
Use to inject config values into your classes. Example:
@Config { id="gzipThreshold" } private Int gzipThreshold
If id
is not provided, it is matched against a combination of field name, class name, and pod name. See user guide for a complete description of the matching strategy.
- id
const Str? id
The id of the config value to be injected.
If
null
then a matching strategy is utilised.- optional
const Bool? optional
optional
means an Err is not thrown if the config cannot be found. Fields are not set if config could not be found. This letsoptional
fields take default values.@Config private Duration? timeToSelfDestruct := 10sec
If
null
then it defaults totrue
if the field is nullable.