Last active
March 9, 2017 10:06
-
-
Save rupert-madden-abbott/68d1fb7f99ada70d21c26f7867f2376d to your computer and use it in GitHub Desktop.
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
meaningful.prefix.username=whatever | |
meaningful.prefix.password=ENC(whatever) |
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
@ConfigurationProperties (prefix = "meaningful.prefix") | |
@Validated | |
public class MeaningfulClassNameHereProperties { | |
/** | |
* The username to access meaningfulServiceNameHerePlease. | |
*/ | |
@NotBlank | |
private String username; | |
/** | |
* The password to access meaningfulServiceNameHerePlease. | |
*/ | |
@NotBlank | |
private String password; | |
//Getters and Setters here | |
} |
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
@Named | |
public class MyCoolService { | |
private final MeaningfulClassNameHereProperties properties; | |
public MyCoolService(MeaningfulClassNameHereProperties properties) { | |
this.properties = properties; | |
} | |
} |
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
... | |
<dependency> | |
<groupId>org.springframework.boot</groupId> | |
<artifactId>spring-boot-configuration-processor</artifactId> | |
<optional>true</optional> | |
</dependency> | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment