@Nullable abstract fun getIfUnique(): T
Return an instance (possibly shared or independent) of the object managed by this factory.
BeansException - in case of creation errors
Return
an instance of the bean, or null if not available or not unique (i.e. multiple candidates found with none marked as primary)
See Also
#getObject()
open fun getIfUnique(defaultSupplier: Supplier<T>): T
Return an instance (possibly shared or independent) of the object managed by this factory.
defaultSupplier - a callback for supplying a default object if no unique candidate is present in the factory
BeansException - in case of creation errors
Return
an instance of the bean, or the supplied default object if no such bean is available or if it is not unique in the factory (i.e. multiple candidates found with none marked as primary)
Since
5.0
See Also
#getIfUnique()