|
3 | 3 | import java.util.Map; |
4 | 4 |
|
5 | 5 | public class CoreConfiguration { |
6 | | - private final Map<String, String> defaultHeader; |
7 | | - private final String serviceAccountKey; |
8 | | - private final String serviceAccountKeyPath; |
9 | | - private final String privateKeyPath; |
10 | | - private final String privateKey; |
11 | | - private final String customEndpoint; |
12 | | - private final String credentialsFilePath; |
13 | | - private final String tokenCustomUrl; |
14 | | - private final Long tokenExpirationLeeway; |
15 | | - |
16 | | - CoreConfiguration(Builder builder) { |
17 | | - this.defaultHeader = builder.defaultHeader; |
18 | | - this.serviceAccountKey = builder.serviceAccountKey; |
19 | | - this.serviceAccountKeyPath = builder.serviceAccountKeyPath; |
20 | | - this.privateKeyPath = builder.privateKeyPath; |
21 | | - this.privateKey = builder.privateKey; |
22 | | - this.customEndpoint = builder.customEndpoint; |
23 | | - this.credentialsFilePath = builder.credentialsFilePath; |
24 | | - this.tokenCustomUrl = builder.tokenCustomUrl; |
25 | | - this.tokenExpirationLeeway = builder.tokenExpirationLeeway; |
26 | | - } |
| 6 | + private Map<String, String> defaultHeader; |
| 7 | + private String serviceAccountKey; |
| 8 | + private String serviceAccountKeyPath; |
| 9 | + private String privateKeyPath; |
| 10 | + private String privateKey; |
| 11 | + private String customEndpoint; |
| 12 | + private String credentialsFilePath; |
| 13 | + private String tokenCustomUrl; |
| 14 | + private Long tokenExpirationLeeway; |
| 15 | + |
| 16 | + public CoreConfiguration() {} |
27 | 17 |
|
28 | 18 | public Map<String, String> getDefaultHeader() { |
29 | 19 | return defaultHeader; |
@@ -61,64 +51,48 @@ public Long getTokenExpirationLeeway() { |
61 | 51 | return tokenExpirationLeeway; |
62 | 52 | } |
63 | 53 |
|
64 | | - public static class Builder { |
65 | | - private Map<String, String> defaultHeader; |
66 | | - private String serviceAccountKey; |
67 | | - private String serviceAccountKeyPath; |
68 | | - private String privateKeyPath; |
69 | | - private String privateKey; |
70 | | - private String customEndpoint; |
71 | | - private String credentialsFilePath; |
72 | | - private String tokenCustomUrl; |
73 | | - private Long tokenExpirationLeeway; |
74 | | - |
75 | | - public Builder defaultHeader(Map<String, String> defaultHeader) { |
76 | | - this.defaultHeader = defaultHeader; |
77 | | - return this; |
78 | | - } |
79 | | - |
80 | | - public Builder serviceAccountKey(String serviceAccountKey) { |
81 | | - this.serviceAccountKey = serviceAccountKey; |
82 | | - return this; |
83 | | - } |
84 | | - |
85 | | - public Builder serviceAccountKeyPath(String serviceAccountKeyPath) { |
86 | | - this.serviceAccountKeyPath = serviceAccountKeyPath; |
87 | | - return this; |
88 | | - } |
89 | | - |
90 | | - public Builder privateKeyPath(String privateKeyPath) { |
91 | | - this.privateKeyPath = privateKeyPath; |
92 | | - return this; |
93 | | - } |
94 | | - |
95 | | - public Builder privateKey(String privateKey) { |
96 | | - this.privateKey = privateKey; |
97 | | - return this; |
98 | | - } |
99 | | - |
100 | | - public Builder customEndpoint(String customEndpoint) { |
101 | | - this.customEndpoint = customEndpoint; |
102 | | - return this; |
103 | | - } |
104 | | - |
105 | | - public Builder credentialsFilePath(String credentialsFilePath) { |
106 | | - this.credentialsFilePath = credentialsFilePath; |
107 | | - return this; |
108 | | - } |
109 | | - |
110 | | - public Builder tokenCustomUrl(String tokenCustomUrl) { |
111 | | - this.tokenCustomUrl = tokenCustomUrl; |
112 | | - return this; |
113 | | - } |
114 | | - |
115 | | - public Builder tokenExpirationLeeway(Long tokenExpirationLeeway) { |
116 | | - this.tokenExpirationLeeway = tokenExpirationLeeway; |
117 | | - return this; |
118 | | - } |
119 | | - |
120 | | - public CoreConfiguration build() { |
121 | | - return new CoreConfiguration(this); |
122 | | - } |
| 54 | + public CoreConfiguration defaultHeader(Map<String, String> defaultHeader) { |
| 55 | + this.defaultHeader = defaultHeader; |
| 56 | + return this; |
| 57 | + } |
| 58 | + |
| 59 | + public CoreConfiguration serviceAccountKey(String serviceAccountKey) { |
| 60 | + this.serviceAccountKey = serviceAccountKey; |
| 61 | + return this; |
| 62 | + } |
| 63 | + |
| 64 | + public CoreConfiguration serviceAccountKeyPath(String serviceAccountKeyPath) { |
| 65 | + this.serviceAccountKeyPath = serviceAccountKeyPath; |
| 66 | + return this; |
| 67 | + } |
| 68 | + |
| 69 | + public CoreConfiguration privateKeyPath(String privateKeyPath) { |
| 70 | + this.privateKeyPath = privateKeyPath; |
| 71 | + return this; |
| 72 | + } |
| 73 | + |
| 74 | + public CoreConfiguration privateKey(String privateKey) { |
| 75 | + this.privateKey = privateKey; |
| 76 | + return this; |
| 77 | + } |
| 78 | + |
| 79 | + public CoreConfiguration customEndpoint(String customEndpoint) { |
| 80 | + this.customEndpoint = customEndpoint; |
| 81 | + return this; |
| 82 | + } |
| 83 | + |
| 84 | + public CoreConfiguration credentialsFilePath(String credentialsFilePath) { |
| 85 | + this.credentialsFilePath = credentialsFilePath; |
| 86 | + return this; |
| 87 | + } |
| 88 | + |
| 89 | + public CoreConfiguration tokenCustomUrl(String tokenCustomUrl) { |
| 90 | + this.tokenCustomUrl = tokenCustomUrl; |
| 91 | + return this; |
| 92 | + } |
| 93 | + |
| 94 | + public CoreConfiguration tokenExpirationLeeway(Long tokenExpirationLeeway) { |
| 95 | + this.tokenExpirationLeeway = tokenExpirationLeeway; |
| 96 | + return this; |
123 | 97 | } |
124 | 98 | } |
0 commit comments