ConditionalOnBean class

Register bean only if a bean of the specified type exists

Example:

@Service()
@ConditionalOnBean(DatabaseService)
class UserCacheService {
  // Only registered if DatabaseService bean exists
}
Inheritance

Constructors

ConditionalOnBean(Type type, {String? qualifier})
const

Properties

hashCode int
The hash code for this object.
no setterinherited
qualifier String?
Optional qualifier to check for
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
type Type
The type to check for
final

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited