classafIoc::ServiceOverrideOptions

sys::Obj
  afIoc::ServiceOverrideOptions

Returned from AppModule ServiceDefinitions methods to allow further override options to be set.

@since 2.0.0

optional

Source

This optional(Bool optional := true)

If true makes this override optional. As in no error is thrown if the service id does not exist. Useful for overriding 3rd party libraries that may or may not exist.

withCtorArgs

Source

This withCtorArgs(Obj?[] ctorArgs)

Passed as args to the service ctor. The args must be immutable.

withFieldVals

Source

This withFieldVals([Field:Obj?]? fieldVals)

Field values to set in the service impl. An alternative to using ctor args. All vals must be immutable.

withImpl

Source

This withImpl(Type implType)

Overrides the service implementation with the given type.

withOverrideId

Source

This withOverrideId(Str overrideId)

Sets an id for this override definition so others may override this override.

withProxy

Source

This withProxy(ServiceProxy proxy := ServiceProxy.always)

Overrides the proxy strategy for the service.

withScope

Source

This withScope(ServiceScope scope)

Overrides the scope of the service.