Skip to content

Instantly share code, notes, and snippets.

@bvulaj bvulaj/AppConfig.java
Last active Mar 14, 2018

Embed
What would you like to do?
Configuring Multiple Objects of the Same Type
@Configuration
public class AppConfig {
@Bean
@ConfigurationProperties("foo")
public ProviderInfo fooProviderInfo() {
return new ProviderInfo();
}
@Bean
@ConfigurationProperties("bar")
public ProviderInfo barProviderInfo() {
return new ProviderInfo();
}
}
foo.name=foo
bar.name=bar
public class ProviderInfo {
private String name;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.