001package io.avaje.inject;
002
003import java.lang.annotation.ElementType;
004import java.lang.annotation.Retention;
005import java.lang.annotation.RetentionPolicy;
006import java.lang.annotation.Target;
007
008/**
009 * Identify a bean as being the least preferred bean to inject when multiple beans implement
010 * the intended interface.
011 * <p>
012 * This can use be used when we have a 'default' implementation that would only be used when
013 * no other implementation is available in the scope to inject.
014 * </p>
015 *
016 * <pre>{@code
017 *
018 * @Secondary
019 * @Singleton
020 * class DefaultEmailSender implements EmailSender {
021 *
022 *   ...
023 * }
024 * }</pre>
025 */
026@Target({ElementType.TYPE, ElementType.METHOD})
027@Retention(RetentionPolicy.RUNTIME)
028public @interface Secondary {
029}