ConditionalOnMissingPod class

An annotation that activates a component only when specific pods are absent from the ConditionalContext.

This enables fallback configuration or alternative service definitions when certain pods are not registered.

Each pod may be referenced by type, qualified name, or pod name. Additionally, the ignoredTypes list can be used to exclude certain pod types from absence checks.

Example

@ConditionalOnMissingPod(
  values: [ClassType<Database>(), 'cacheService'],
  ignoredTypes: [ClassType<Logger>()],
)
class FallbackConfig {}

The above activates only if:

  • Neither Database nor a pod named cacheService exist,
  • And the Logger pod is ignored during evaluation.
Inheritance
Annotations
  • @Conditional([OnPodCondition()])
  • @Target.new({TargetKind.classType, TargetKind.method})

Constructors

ConditionalOnMissingPod({List<Object> values = const [], List<Object> ignoredTypes = const []})
An annotation that activates a component only when specific pods are absent from the ConditionalContext.
const

Properties

annotationType Type
Returns the annotation _type of this annotation.
no setter
hashCode int
The hash code for this object.
no setterinherited
ignoredTypes List<Object>
A list of pod types to ignore during absence checks.
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
values List<Object>
The main list of pod references that must be absent.
final

Methods

equalizedProperties() List<Object?>
Mixin-style contract for value-based equality, hashCode, and toString.
equals(Object other) bool
Checks whether the given object is logically equivalent to this annotation.
inherited
getClasses() List<Class>
Returns a list of all resolved Class objects represented in values.
getIgnoredTypes() List<Class>
Returns a list of ignored Class types derived from ignoredTypes.
getPodNames() List<String>
Returns a list of pod names (non-class string values) from values.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
Returns a string representation of this annotation.

Operators

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