|
4 | 4 |
|
5 | 5 | package io.airbyte.commons.workers.config;
|
6 | 6 |
|
| 7 | +import org.slf4j.Logger; |
| 8 | +import org.slf4j.LoggerFactory; |
| 9 | + |
7 | 10 | import java.util.Collections;
|
8 | 11 | import java.util.HashMap;
|
9 | 12 | import java.util.Map;
|
10 | 13 | import java.util.regex.Matcher;
|
11 | 14 | import java.util.regex.Pattern;
|
12 |
| -import lombok.AccessLevel; |
13 |
| -import lombok.NoArgsConstructor; |
14 |
| -import lombok.extern.slf4j.Slf4j; |
15 | 15 |
|
16 |
| -@Slf4j |
17 |
| -@NoArgsConstructor(access = AccessLevel.PRIVATE) |
18 | 16 | class EnvUtils {
|
19 | 17 |
|
| 18 | + private static final Logger LOGGER = LoggerFactory.getLogger(EnvUtils.class); |
| 19 | + |
20 | 20 | private static final Pattern KEY_JSON_VALUE_PATTERN = Pattern.compile("(?<key>[^=]+)\\s*?=\\s*?(?<value>\\{[^=]+})\\s*,?\\s*");
|
21 | 21 | private static final Pattern KEY_VALUE_PATTERN = Pattern.compile("(?<key>[^=]+)=(?<value>[^=,]+),?");
|
22 | 22 | private static final String KEY_GROUP_ALIAS = "key";
|
23 | 23 | private static final String VALUE_GROUP_ALIAS = "value";
|
24 | 24 |
|
| 25 | + private EnvUtils() {} |
| 26 | + |
25 | 27 | /**
|
26 | 28 | * Splits key value pairs from the input string into a map. Each kv-pair is separated by a ','.
|
27 | 29 | * </br>
|
@@ -58,7 +60,7 @@ private static Map<String, String> match(final String input, final Pattern patte
|
58 | 60 | private static Map<String, String> getKVPairsMatchedWithSimplePattern(final String input) {
|
59 | 61 | final Map<String, String> stringMatchResult = match(input, KEY_VALUE_PATTERN);
|
60 | 62 | if (stringMatchResult.isEmpty()) {
|
61 |
| - log.warn("No valid key value pairs found in the input string: {}", input); |
| 63 | + LOGGER.warn("No valid key value pairs found in the input string: {}", input); |
62 | 64 | return Collections.emptyMap();
|
63 | 65 | }
|
64 | 66 | return stringMatchResult;
|
|
0 commit comments