@Target(value=TYPE) public @interface Variant
Variant
as an
implemented interface. A spring configuration is generated. A variant specification is usually the root of a set of
features
. In the context of an application, this is usually a certain version (if
there is, for instance, a standard and a professional version of the application) or a customer (if there is a specific
manifestation of the application for each customer).
@Variant(features = #[Feature1])
class Variant1 {
}
Leads to:
@Configuration
@ConditionalOnProperty(name = "variant", havingValue = "Variant1")
public class Variant1 implements Variant {
public final static String NAME = "Variant1";
@Bean
public String variant() {
return Variant1.NAME;
}
@Bean
@ConditionalOnProperty(name = "de.bmiag.tapir.variant.test.filter.data.Feature1.active", havingValue = "true", matchIfMissing = true)
public Feature1 feature1() {
return new Feature1();
}
}
Variant
Modifier and Type | Optional Element and Description |
---|---|
Class<? extends Feature>[] |
features
Returns the features which are available in this variant.
|
String |
name
Returns the name of the variant.
|
String |
propertyName
Returns the name of the property which determines the active variant.
|
public abstract String name
public abstract String propertyName
Copyright © 2018–2021 b+m Informatik AG. All rights reserved.