Class Configurations
java.lang.Object
org.springframework.boot.context.annotation.Configurations
- Direct Known Subclasses:
- UserConfigurations
A set of 
@Configuration classes that can be registered in
 ApplicationContext. Classes can be returned from one or more
 Configurations instances by using getClasses(Configurations[]). The
 resulting array follows the ordering rules usually applied by the
 ApplicationContext and/or custom ImportSelector implementations.
 
 This class is primarily intended for use with tests that need to specify configuration
 classes but can't use SpringRunner.
 
 Implementations of this class should be annotated with @Order or
 implement Ordered.
- Since:
- 2.0.0
- See Also:
- 
Constructor SummaryConstructorsModifierConstructorDescriptionprotectedConfigurations(Collection<Class<?>> classes) Create a newConfigurationsinstance.protectedConfigurations(@Nullable UnaryOperator<Collection<Class<?>>> sorter, Collection<Class<?>> classes, Function<Class<?>, String> beanNameGenerator) Create a newConfigurationsinstance.
- 
Method SummaryModifier and TypeMethodDescriptionstatic List<Configurations> collate(Collection<Configurations> configurations) Collate the given configuration by sorting and merging them.@Nullable StringgetBeanName(Class<?> beanClass) Return the bean name that should be used for the given configuration class ornullto use the default name.static Class<?>[]getClasses(Collection<Configurations> configurations) Return the classes from all the specified configurations in the order that they would be registered.static Class<?>[]getClasses(Configurations... configurations) Return the classes from all the specified configurations in the order that they would be registered.protected abstract ConfigurationsMerge configurations.protected Configurationsmerge(Configurations other) Merge configurations from another source of the same type.
- 
Constructor Details- 
ConfigurationsCreate a newConfigurationsinstance.- Parameters:
- classes- the configuration classes
 
- 
Configurationsprotected Configurations(@Nullable UnaryOperator<Collection<Class<?>>> sorter, Collection<Class<?>> classes, Function<Class<?>, String> beanNameGenerator) Create a newConfigurationsinstance.- Parameters:
- sorter- a- UnaryOperatorused to sort the configurations
- classes- the configuration classes
- beanNameGenerator- an optional function used to generate the bean name
- Since:
- 3.4.0
 
 
- 
- 
Method Details- 
getClasses
- 
mergeMerge configurations from another source of the same type.- Parameters:
- other- the other- Configurations(must be of the same type as this instance)
- Returns:
- a new configurations instance (must be of the same type as this instance)
 
- 
mergeMerge configurations.- Parameters:
- mergedClasses- the merged classes
- Returns:
- a new configurations instance (must be of the same type as this instance)
 
- 
getBeanName
- 
getClassesReturn the classes from all the specified configurations in the order that they would be registered.- Parameters:
- configurations- the source configuration
- Returns:
- configuration classes in registration order
 
- 
getClassesReturn the classes from all the specified configurations in the order that they would be registered.- Parameters:
- configurations- the source configuration
- Returns:
- configuration classes in registration order
 
- 
collateCollate the given configuration by sorting and merging them.- Parameters:
- configurations- the source configuration
- Returns:
- the collated configurations
- Since:
- 3.4.0
 
 
-