Skip to content

Instantly share code, notes, and snippets.

@behrangsa
Forked from anonymous/CommonProperties.java
Last active January 8, 2018 11:21
Show Gist options
  • Save behrangsa/61f60b0e70c6d3e2fec3f2cd432df517 to your computer and use it in GitHub Desktop.
Save behrangsa/61f60b0e70c6d3e2fec3f2cd432df517 to your computer and use it in GitHub Desktop.
@Data
@Component
@ConfigurationProperties(prefix = "sample")
@Validated
public class SampleProperties {
@NotNull
private String sample1;
}
@Data
@Component
@ConfigurationProperties(prefix = "sample.more")
@Validated
@Profile("more")
public class MoreProperties {
@NotNull
private String sample2;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment