|
2 | 2 |
|
3 | 3 | import lombok.Builder;
|
4 | 4 | import lombok.Getter;
|
5 |
| -import lombok.Setter; |
6 | 5 | import lombok.extern.slf4j.Slf4j;
|
7 | 6 | import org.springframework.util.StringUtils;
|
8 | 7 |
|
9 | 8 | @Slf4j
|
10 | 9 | @Getter
|
11 |
| -@Setter |
12 | 10 | @Builder
|
13 | 11 | public class SisHikariConfigProfileDto {
|
14 |
| - private String username; |
15 |
| - private String password; |
16 |
| - private String maxPoolSize; |
17 |
| - private String tnsJdbcUrl; |
18 |
| - private String driverClassName; |
19 |
| - private String connectionTimeout; |
20 |
| - private String maxLifetime; |
21 | 12 |
|
22 |
| - public static void checkProfileVariables(SisHikariConfigProfileDto hikariConfigProfile) { |
| 13 | + private final String username; |
| 14 | + private final String password; |
| 15 | + private final String maxPoolSize; |
| 16 | + private final String tnsJdbcUrl; |
| 17 | + private final String driverClassName; |
| 18 | + private final String connectionTimeout; |
| 19 | + private final String maxLifetime; |
| 20 | + |
| 21 | + public static void checkProfileVariables(final SisHikariConfigProfileDto hikariConfigProfile) { |
23 | 22 | if (!StringUtils.hasText(hikariConfigProfile.getUsername())) {
|
24 |
| - String message = "Hikari username Cannot be Empty!"; |
| 23 | + final String message = "Hikari username Cannot be Empty!"; |
25 | 24 | log.error(message);
|
26 | 25 | throw new NullPointerException(message);
|
27 | 26 | }
|
28 | 27 | if (!StringUtils.hasText(hikariConfigProfile.getPassword())) {
|
29 |
| - String message = "Hikari password Cannot be Empty!"; |
| 28 | + final String message = "Hikari password Cannot be Empty!"; |
30 | 29 | log.error(message);
|
31 | 30 | throw new NullPointerException(message);
|
32 | 31 | }
|
33 | 32 | if (!StringUtils.hasText(hikariConfigProfile.getTnsJdbcUrl())) {
|
34 |
| - String message = "Hikari tnsJdbcUrl Cannot be Empty!"; |
| 33 | + final String message = "Hikari tnsJdbcUrl Cannot be Empty!"; |
35 | 34 | log.error(message);
|
36 | 35 | throw new NullPointerException(message);
|
37 | 36 | }
|
38 | 37 | if (!StringUtils.hasText(hikariConfigProfile.getMaxPoolSize())) {
|
39 |
| - String message = "Hikari maxPoolSize Cannot be Empty!"; |
| 38 | + final String message = "Hikari maxPoolSize Cannot be Empty!"; |
40 | 39 | log.error(message);
|
41 | 40 | throw new NullPointerException(message);
|
42 | 41 | }
|
43 | 42 | if (!StringUtils.hasText(hikariConfigProfile.getConnectionTimeout())) {
|
44 |
| - String message = "Hikari connectionTimeout Cannot be Empty!"; |
| 43 | + final String message = "Hikari connectionTimeout Cannot be Empty!"; |
45 | 44 | log.error(message);
|
46 | 45 | throw new NullPointerException(message);
|
47 | 46 | }
|
48 | 47 | if (!StringUtils.hasText(hikariConfigProfile.getMaxLifetime())) {
|
49 |
| - String message = "Hikari maxLifetime Cannot be Empty!"; |
| 48 | + final String message = "Hikari maxLifetime Cannot be Empty!"; |
50 | 49 | log.error(message);
|
51 | 50 | throw new NullPointerException(message);
|
52 | 51 | }
|
|
0 commit comments