classafIoc::MappedConfig

sys::Obj
  afIoc::MappedConfig

Passed into module contribution methods to allow the method to, err, contribute!

A service can collect contributions in three different ways:

  • As an unordered list of values
  • As an ordered list of values
  • As a map of keys and values

The service defines the type of contribution by declaring a parameterised list or map in its ctor or builder method. Contributions must be compatible with the type.

autobuild

Source

Obj autobuild(Type type, Obj?[] ctorArgs := Obj#.emptyList())

A util method to instantiate an object, injecting any dependencies. See Registry.autobuild.

remove

Source

This remove(Obj existingKey, Obj? newKey := null)

A special kind of override whereby, should this be the last override applied, the value is removed from the configuration.

Note: If a newKey is supplied then this override itself may be overridden by other contributions. 3rd party libraries, when overriding, should always supply a newKey.

@since 1.4.0

set

Source

@Operator
This set(Obj key, Obj? val)

Adds a keyed object to the service's configuration. An attempt is made to coerce the key / value to the map type.

setAll

Source

This setAll(Obj:Obj? objects)

Adds all the mapped objects to a service's configuration. An attempt is made to coerce the keys / values to the map type.

setOverride

Source

This setOverride(Obj existingKey, Obj? newValue, Obj? newKey := null)

Overrides an existing contribution by its key. The key must exist. An attempt is made to coerce the override key / value to the map type.

Note: Override keys may a Str

Note: If a newId is supplied then this override itself may be overridden by other contributions. 3rd party libraries, when overriding, should always supply a newId.

@since 1.2.0

toStr

Source

virtual override Str toStr()