Last active
March 14, 2018 22:18
-
-
Save bvulaj/43b80f72e51f2ceb874faffddd969209 to your computer and use it in GitHub Desktop.
Configuring Multiple Objects of the Same Type
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@Configuration | |
public class AppConfig { | |
@Bean | |
@ConfigurationProperties("foo") | |
public ProviderInfo fooProviderInfo() { | |
return new ProviderInfo(); | |
} | |
@Bean | |
@ConfigurationProperties("bar") | |
public ProviderInfo barProviderInfo() { | |
return new ProviderInfo(); | |
} | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
foo.name=foo | |
bar.name=bar |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class ProviderInfo { | |
private String name; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment