File tree Expand file tree Collapse file tree
spring-boot/static/src/main/java/io/reflectoring/staticdata Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11package io .reflectoring .staticdata ;
22
3- public class Quote {
3+ import org . springframework . boot . context . properties . ConstructorBinding ;
44
5- private String text ;
6- private String author ;
5+ @ ConstructorBinding
6+ class Quote {
77
8- public Quote () {
8+ private final String text ;
9+ private final String author ;
10+
11+ public Quote (String text , String author ) {
12+ this .text = text ;
13+ this .author = author ;
914 }
1015
11- public String getText () {
16+ String getText () {
1217 return text ;
1318 }
1419
15- public String getAuthor () {
20+ String getAuthor () {
1621 return author ;
1722 }
1823
19- public void setText (String text ) {
20- this .text = text ;
21- }
22-
23- public void setAuthor (String author ) {
24- this .author = author ;
25- }
2624}
Original file line number Diff line number Diff line change 77
88@ Component
99@ ConfigurationProperties ("static" )
10- public class QuotesProperties {
10+ class QuotesProperties {
1111
1212 private final List <Quote > quotes ;
1313
14- public QuotesProperties (List <Quote > quotes ) {
14+ QuotesProperties (List <Quote > quotes ) {
1515 this .quotes = quotes ;
1616 }
1717
18- public List <Quote > getQuotes () {
18+ List <Quote > getQuotes () {
1919 return this .quotes ;
2020 }
2121
Original file line number Diff line number Diff line change 1010
1111@ Configuration
1212@ EnableScheduling
13- public class RandomQuotePrinter {
13+ class RandomQuotePrinter {
1414
1515 private static final Logger logger = LoggerFactory .getLogger (RandomQuotePrinter .class );
1616 private final Random random = new Random ();
1717 private final QuotesProperties quotesProperties ;
1818
19- public RandomQuotePrinter (QuotesProperties quotesProperties ) {
19+ RandomQuotePrinter (QuotesProperties quotesProperties ) {
2020 this .quotesProperties = quotesProperties ;
2121 }
2222
Original file line number Diff line number Diff line change 22
33import org .springframework .boot .SpringApplication ;
44import org .springframework .boot .autoconfigure .SpringBootApplication ;
5- import org .springframework .boot .context .properties .EnableConfigurationProperties ;
65
76@ SpringBootApplication
87public class StaticApplication {
You can’t perform that action at this time.
0 commit comments