io.dinject.Primary Maven / Gradle / Ivy
package io.dinject;
import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
/**
* Identify a bean as being the preferred bean to inject when multiple beans implement
* the intended interface.
*
* {@code
*
* @Primary
* @Singleton
* class PreferredEmailSender implements EmailSender {
*
* ...
* }
* }
*/
@Target({ElementType.TYPE, ElementType.METHOD})
@Retention(RetentionPolicy.RUNTIME)
public @interface Primary {
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy