Qualifiers are required in some cases to resolve conflicts during dependency injection by identifying the correct bean with a qualified name. In the last section, we discussed injecting the dependencies. We injected defaultPreferredLanguage in the IdentityCreator class that was produced by the Producer function of the PreferredLanguageProducer class. If we want to inject another field of the same type, we then have a problem. If we have another function that produces a bean of the PreferredLanguage type, the CDI wouldn't know which one to consider and inject. In order to solve this, we can specify qualifiers, such as the @Named annotation.
@Named is a qualifier that is shipped by the CDI. It is annotated with @Qualifier and can qualify string values for instances to be injected.
Let's say that we want to have several preferredLanguage types, based on a context...