classafIoc::ServiceOverrideOptions
sys::Obj afIoc::ServiceOverrideOptions
Returned from AppModule
ServiceDefinitions methods to allow further override options to be set.
@since 2.0.0
- optional
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
This withCtorArgs(Obj?[] ctorArgs)
Passed as args to the service ctor. The args must be immutable.
- withFieldVals
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
Overrides the service implementation with the given type.
- withOverrideId
This withOverrideId(Str overrideId)
Sets an id for this override definition so others may override this override.
- withProxy
This withProxy(ServiceProxy proxy := ServiceProxy.always)
Overrides the proxy strategy for the service.
- withScope
This withScope(ServiceScope scope)
Overrides the scope of the service.