Skip to content

Commit e55db05

Browse files
committed
BAEL-6007: formatting
1 parent d683971 commit e55db05

File tree

6 files changed

+90
-84
lines changed

6 files changed

+90
-84
lines changed

docker-modules/docker-multi-module-maven/api/src/main/java/com/baeldung/api/Application.java

+9-8
Original file line numberDiff line numberDiff line change
@@ -9,14 +9,15 @@
99
@SpringBootApplication
1010
public class Application {
1111

12-
public static void main(String[] args) {
13-
SpringApplication.run(Application.class, args);
14-
}
12+
public static void main(String[] args) {
13+
SpringApplication.run(Application.class, args);
14+
}
1515

16-
@Configuration
17-
@EntityScan(basePackages = "com.baeldung.domain")
18-
@EnableJpaRepositories(basePackages = "com.baeldung.domain")
19-
static class Config {
20-
}
16+
@Configuration
17+
@EntityScan(basePackages = "com.baeldung.domain")
18+
@EnableJpaRepositories(basePackages = "com.baeldung.domain")
19+
static class Config {
20+
21+
}
2122

2223
}

docker-modules/docker-multi-module-maven/api/src/main/java/com/baeldung/api/StaticDataLoader.java

+13-11
Original file line numberDiff line numberDiff line change
@@ -2,22 +2,24 @@
22

33
import com.baeldung.domain.Country;
44
import com.baeldung.domain.CountryRepository;
5+
56
import org.springframework.boot.CommandLineRunner;
67
import org.springframework.stereotype.Component;
78

89
@Component
910
class StaticDataLoader implements CommandLineRunner {
10-
private final CountryRepository countries;
1111

12-
public StaticDataLoader(CountryRepository countries) {
13-
this.countries = countries;
14-
}
12+
private final CountryRepository countries;
13+
14+
public StaticDataLoader(CountryRepository countries) {
15+
this.countries = countries;
16+
}
1517

16-
@Override
17-
public void run(String... args) {
18-
countries.save(new Country(1L, "US", "United States", ":us:"));
19-
countries.save(new Country(2L, "CA", "Canada", ":canada:"));
20-
countries.save(new Country(3L, "GB", "United Kingdom", ":uk:"));
21-
countries.save(new Country(4L, "AU", "Romania", ":romania:"));
22-
}
18+
@Override
19+
public void run(String... args) {
20+
countries.save(new Country(1L, "US", "United States", ":us:"));
21+
countries.save(new Country(2L, "CA", "Canada", ":canada:"));
22+
countries.save(new Country(3L, "GB", "United Kingdom", ":uk:"));
23+
countries.save(new Country(4L, "AU", "Romania", ":romania:"));
24+
}
2325
}

docker-modules/docker-multi-module-maven/api/src/main/java/com/baeldung/api/controller/CountriesController.java

+12-11
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
import com.baeldung.domain.Country;
44
import com.baeldung.domain.CountryRepository;
5+
56
import org.springframework.web.bind.annotation.GetMapping;
67
import org.springframework.web.bind.annotation.RestController;
78

@@ -12,19 +13,19 @@
1213

1314
@RestController
1415
public class CountriesController {
15-
private final CountryRepository countries;
1616

17-
public CountriesController(CountryRepository countries) {
18-
this.countries = countries;
19-
}
17+
private final CountryRepository countries;
18+
19+
public CountriesController(CountryRepository countries) {
20+
this.countries = countries;
21+
}
2022

21-
@GetMapping("api/countries")
22-
public List<CountryDto> index() {
23+
@GetMapping("api/countries")
24+
public List<CountryDto> index() {
2325

24-
Iterable<Country> all = countries.findAll();
25-
return stream(all.spliterator(), false)
26-
.map(it -> new CountryDto(it.getId(), it.getName(), it.getIso(), it.getEmoji()))
27-
.collect(toList());
28-
}
26+
Iterable<Country> all = countries.findAll();
27+
return stream(all.spliterator(), false).map(it -> new CountryDto(it.getId(), it.getName(), it.getIso(), it.getEmoji()))
28+
.collect(toList());
29+
}
2930

3031
}
Original file line numberDiff line numberDiff line change
@@ -1,31 +1,32 @@
11
package com.baeldung.api.controller;
22

33
public class CountryDto {
4-
private final Long id;
5-
private final String name;
6-
private final String code;
7-
private final String emoji;
84

9-
public CountryDto(Long id, String name, String code, String emoji) {
10-
this.id = id;
11-
this.name = name;
12-
this.code = code;
13-
this.emoji = emoji;
14-
}
5+
private final Long id;
6+
private final String name;
7+
private final String code;
8+
private final String emoji;
159

16-
public Long getId() {
17-
return id;
18-
}
10+
public CountryDto(Long id, String name, String code, String emoji) {
11+
this.id = id;
12+
this.name = name;
13+
this.code = code;
14+
this.emoji = emoji;
15+
}
1916

20-
public String getName() {
21-
return name;
22-
}
17+
public Long getId() {
18+
return id;
19+
}
2320

24-
public String getCode() {
25-
return code;
26-
}
21+
public String getName() {
22+
return name;
23+
}
2724

28-
public String getEmoji() {
29-
return emoji;
30-
}
25+
public String getCode() {
26+
return code;
27+
}
28+
29+
public String getEmoji() {
30+
return emoji;
31+
}
3132
}

docker-modules/docker-multi-module-maven/domain/src/main/java/com/baeldung/domain/Country.java

+32-31
Original file line numberDiff line numberDiff line change
@@ -5,35 +5,36 @@
55

66
@Entity
77
public class Country {
8-
@Id
9-
private Long id;
10-
private String iso;
11-
private String name;
12-
private String emoji;
13-
14-
public Country(Long id, String iso, String name, String emoji) {
15-
this.id = id;
16-
this.iso = iso;
17-
this.name = name;
18-
this.emoji = emoji;
19-
}
20-
21-
public Country() {
22-
}
23-
24-
public Long getId() {
25-
return id;
26-
}
27-
28-
public String getIso() {
29-
return iso;
30-
}
31-
32-
public String getName() {
33-
return name;
34-
}
35-
36-
public String getEmoji() {
37-
return emoji;
38-
}
8+
9+
@Id
10+
private Long id;
11+
private String iso;
12+
private String name;
13+
private String emoji;
14+
15+
public Country(Long id, String iso, String name, String emoji) {
16+
this.id = id;
17+
this.iso = iso;
18+
this.name = name;
19+
this.emoji = emoji;
20+
}
21+
22+
public Country() {
23+
}
24+
25+
public Long getId() {
26+
return id;
27+
}
28+
29+
public String getIso() {
30+
return iso;
31+
}
32+
33+
public String getName() {
34+
return name;
35+
}
36+
37+
public String getEmoji() {
38+
return emoji;
39+
}
3940
}

docker-modules/docker-multi-module-maven/domain/src/main/java/com/baeldung/domain/CountryRepository.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
import org.springframework.data.repository.CrudRepository;
44
import org.springframework.stereotype.Repository;
55

6-
76
@Repository
87
public interface CountryRepository extends CrudRepository<Country, Long> {
8+
99
}

0 commit comments

Comments
 (0)