All Downloads are FREE. Search and download functionalities are using the official Maven repository.

io.quarkus.arc.profile.UnlessBuildProfile Maven / Gradle / Ivy

There is a newer version: 3.17.0.CR1
Show newest version
package io.quarkus.arc.profile;

import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;

/**
 * When applied to a bean class or producer method (or field), the bean will only be enabled
 * if the Quarkus build time profile does not match the rules of the annotation values.
 *
 * 
* *
 *    Enabled when "dev" profile is not active:
 *
 *    @ApplicationScoped
 *    @UnlessBuildProfile("dev")
 *    public class NotDevBean {
 *    }
 *
 *    Enabled when both "build" and "dev" profiles are not active:
 *
 *    @ApplicationScoped
 *    @UnlessBuildProfile(allOf = {"build", "dev"})
 *    public class NotBuildDevBean {
 *    }
 *
 *    Enabled if either "build" or "dev" profile is not active:
 *
 *    @ApplicationScoped
 *    @UnlessBuildProfile(anyOf = {"build", "dev"})
 *    public class NotBuildDevBean {
 *    }
 *
 *    Enabled when both "build" and "dev" profiles are not active and either "test" or "prod" profile is
 *    not active:
 *
 *    @ApplicationScoped
 *    @UnlessBuildProfile(allOf = {"build", "dev"}, anyOf = {"test", "prod"})
 *    public class NotBuildDevBean {
 *    }
 * 
* *
*/ @Retention(RetentionPolicy.RUNTIME) @Target({ ElementType.METHOD, ElementType.TYPE, ElementType.FIELD }) public @interface UnlessBuildProfile { /** * A single profile name to enable a bean if a profile with the same name is not active in Quarkus build * time config. */ String value() default ""; /** * Multiple profiles names to enable a bean if all the profile names are not active in Quarkus build time * config. */ String[] allOf() default {}; /** * Multiple profiles names to enable a bean if any the profile names is not active in Quarkus build time * config. */ String[] anyOf() default {}; }




© 2015 - 2024 Weber Informatics LLC | Privacy Policy