Package org.apache.maven.api.di
Annotation Interface Named
Provides a unique identifier for dependencies when multiple implementations
of the same type are available.
This annotation can be used in conjunction with Inject
to specify
which implementation should be injected when multiple candidates exist.
The value represents a unique identifier for the dependency.
Example usage:
@Inject @Named("mysql") private Repository mysqlRepository;
-
Optional Element Summary
Optional Elements
-
Element Details
-
value
String valueThe name identifier for the annotated element.If no value is specified, the default empty string will be used. When used as a qualifier, this value helps distinguish between different implementations or instances of the same type.
- Returns:
- the name that identifies this component
- Default:
- ""
-